#4875 closed defect (invalid)
Calling editor.destroy() results in an error being thrown (related to #3726)
Reported by: | guest | Owned by: | Adam Peller |
---|---|---|---|
Priority: | high | Milestone: | 1.0 |
Component: | Editor | Version: | 0.9 |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description (last modified by )
Attachments (1)
Change History (11)
comment:1 Changed 13 years ago by
Description: | modified (diff) |
---|---|
Milestone: | → 1.0 |
Owner: | changed from liucougar to Adam Peller |
comment:2 Changed 13 years ago by
comment:3 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Please attach code to reproduce this and whether it is dependent on platform, etc.
I suspect destroy() is being called twice.
comment:4 Changed 13 years ago by
Milestone: | 1.0 → 1.1 |
---|---|
Resolution: | invalid |
Status: | closed → reopened |
take another look in 1.1. Ben says he was calling destroyDescendants() and destroy(). If that's a valid thing to do, we should check toolbar before destroying it.
comment:5 Changed 13 years ago by
I'm attaching a test file that demonstrates the behavior. Obviously this isn't very critical, but it does work for Textarea and TextBox?. I'm not quite sure that my order of operations is 'valid', so this could still be an invalid issue.
comment:6 follow-up: 9 Changed 13 years ago by
Milestone: | 1.1 → 1.0 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
this.destroyDescendants() destroys textarea, textbox and edtior, so you don't need to call destroy on all of them separately again
in addition, I don't think you need your custom clear() function at all, just call destroyRecursive(), it should do all the work for you
mark as invalid
comment:7 Changed 13 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:8 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
comment:9 follow-up: 10 Changed 13 years ago by
Replying to liucougar:
this.destroyDescendants() destroys textarea, textbox and edtior, so you don't need to call destroy on all of them separately again
in addition, I don't think you need your custom clear() function at all, just call destroyRecursive(), it should do all the work for you
mark as invalid
But that's entirely my point. The textarea, textbox, and editor are NOT being destroyed by destroyDescendants. For some reason only the Editor's toolbar is being destroyed. This seems like odd behavior.
Additionally, calling destroyRecursive() destroys the entire widget. In this instance, that is not the desired behavior, I simply wanted to ensure I've destroyed any child widgets that I've programmatically created.
Again, I'm not claiming this particular issue is valid, but it does seem like there is a bug *somewhere* in all of this. Why some widgets (the Editor's toolbar) are destroyed and some aren't by destroyDescendants is really my question.
comment:10 Changed 13 years ago by
Replying to guest:
But that's entirely my point. The textarea, textbox, and editor are NOT being destroyed by destroyDescendants.
Textarea, textbox, and editor are being destroyed by destroyDescendants(). It's just that you are left with stray pointers (this.textbox, etc.) to those destroyed widgets.
Any idea why the delete call fails? I guess we can just comment it out but it's mysterious.