Opened 14 years ago

Closed 14 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:


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.

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("-removeChild", function(c) { c.destroyRecursive(); }) seems to be one effective workaround.

Change History (1)

comment:1 Changed 14 years ago by bill

Resolution: duplicate
Status: newclosed

Dup of #4381.

Note: See TracTickets for help on using tickets.