Opened 13 years ago
Closed 13 years ago
#6287 closed defect (duplicate)
StackContainer closeChild results in orphaned grandchild widgets
Reported by: | guest | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Dijit | Version: | 1.0 |
Keywords: | StackContainer TabContainer destroy children leak | Cc: | [email protected]… |
Blocked By: | Blocking: |
Description
I have a StackContainer? with some closable pages that get added dynamically. The pages are themselves TabContainers? w/ContentPanes (including dijit.form elements):
. StackContainer? .. (button) TabContainer? 1 .. (button) TabContainer? 2 [x] .... (tab) ContentPane? [x] ...... dijit.form.TextBox? .. (button) TabContainer? 3
Closing a child page (either [x] icon) results in orphaned grandchild widgets. They are still in dijit.registry, but since the DOM chain is broken higher level destroyRecursives no longer cover them.
- [x] / StackContainer?.closeChild only calls .destroy() on the removed page
- Stack/TabContainer?.destroy() does not destroy any child pages
Is there a reason why [x] does not call destroyRecursive and/or why StackContainer?.destroy does not at least destroy getChildren ?
I think StackContainer? should either always destroyRecursive its child pages or never destroy them at all. The current mixed behavior makes debugging dijit.registry ghosts especially difficult.
dojo.subscribe(stackOrTabContainer.id"-removeChild", function(c) { c.destroyRecursive(); }) seems to be one effective workaround.
Dup of #4381.