Opened 13 years ago
Closed 13 years ago
#6122 closed defect (fixed)
TabContainer: failure on unload on IE7
Reported by: | bill | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.1 |
Component: | Dijit | Version: | 1.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
After attaching MSE7 to IE7 running themeTester, and then refreshing the page, get exception while unloading the (initial) page, in Menu::unBindDomNode because it's trying to unbind from dijit_layoutTabButton_5 but dojo.byId("dijit_layoutTabButton_5") is null.
Looks like StackController? isn't properly cleaning up the Menus it created when it's destroyed. StackController? needs to clean up on destroy(), and also on onRemoveChild().
Proably also Menu should be more forgiving if the DOM node to which it was attached is no longer there, but the root problem is StackController? cleaning up Menus.
Attachments (2)
Change History (9)
comment:1 Changed 13 years ago by
Priority: | normal → high |
---|
Changed 13 years ago by
Attachment: | 6122.patch added |
---|
comment:2 Changed 13 years ago by
Status: | new → assigned |
---|
I stepped this through the debugger and menus are now destroyed in onRemoveChild and onRemoveChild now gets called in stackController.destroy. However, since I could not reproduce the exact conditions I would appreciate it if someone could test before I commit.
comment:4 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Changed 13 years ago by
Attachment: | StackContainer.patch added |
---|
Add a guard to ensure container exists
comment:5 Changed 13 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I don't know why, but StackController?.destroy() is being invoked twice on a Rails+Dojo application I'm working on. I submitted a patch to guard against an undefined variable, but I'm not sure this fixes all cases, and it certainly doesn't fix the root cause behind destroy() being invoked twice.
-lalee
comment:6 Changed 13 years ago by
Owner: | changed from Becky Gibson to bill |
---|---|
Status: | reopened → new |
Let me work on this some. I'm not sure what's happening with lalee's comment above, but page unload causes a call to
WidgetSet.forEach(function(widget){ widget.destroy(); })
... which unfortunately apparently deletes the widgets in a random order. In particular the TabContainer's children are getting deleted before the TabContainer or the TabController, which means that this code in TabController is doing nothing:
var container = dijit.byId(this.containerId); dojo.forEach(container.getChildren(), this.onRemoveChild, this);
comment:7 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [13089]) StackController?.destroy() shouldn't access StackContainer?'s children, because they may already have been deleted. (Case in point: on page unload.). Also, Menu.destroy() needs to be resilient if the target node has already been destroyed (which also happens on page unload).
Fixes #6122 !strict
remove menu in onRemoveChild and call onRemoveChild from stackcontainer.destroy()