Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9966 closed defect (fixed)

dojoAttachPoints leak

Reported by: bill Owned by: bill
Priority: high Milestone: 1.4
Component: Dijit Version: 1.3.2
Keywords: Cc:
Blocked By: Blocking:

Description

Apparently IE6 is leaking because _Widget.destroy doesn't null out/delete all the attachPoint references like this.containerNode, this.domNode, etc.

Simple enough to add that code.

Change History (8)

comment:1 Changed 10 years ago by bill

Resolution: fixed
Status: newclosed

(In [20248]) Avoid a memory leak on IE6. Fixes #9966 !strict.

comment:2 Changed 10 years ago by Douglas Hays

Priority: normalhigh
Resolution: fixed
Status: closedreopened

IE6 is throwing an exception when destroy() is run after this changeset was committed.
I loaded test_Menu.html in IE6 and pressed the browser's Home Key and an exception is thrown "undefined is null or not an object".

comment:3 Changed 10 years ago by bill

Ah, thanks for the heads up. Looks like submenu2 is getting destroyed when it's parent PopupMenuItem is destroyed, but it's also getting another destroy() call from the loop in manager.js:

dojo.addOnWindowUnload(function(){
	dojo.forEach(dijit.findWidgets(dojo.body()), function(widget){
		if(widget.destroyRecursive){
			widget.destroyRecursive();
		}else if(widget.destroy){
			widget.destroy();
		}
	});
});

It's because every Menu is a child of <body> even though logically submenu2 is a child of another Menu's PopupMenuItem.

Guess I just need to add some flags to prevent double destroys.

comment:4 Changed 10 years ago by bill

(In [20294]) Deleting all attach points was happening too early. Specifically, methods like Combobox.uninitialize() were being called after the delete and trying to reference the deleted attach points. Refs #9966 !strict.

comment:5 Changed 10 years ago by Douglas Hays

Seems OK now. Can this be closed?

comment:6 Changed 10 years ago by bill

Yes, actually closed it before but the comment got lost:

(In [20293]) Avoid double destroy() on widgets like Menu that are logically children of other widgets even though they are attached to <body> and thus picked up as "top level widgets". Fixes #9966 !strict.

comment:7 Changed 10 years ago by bill

Resolution: fixed
Status: reopenedclosed

(In [20312]) Safeguarding against double destroy() on a few more widgets with popups. Fixes #9966 !strict.

comment:8 Changed 10 years ago by bill

(In [21124]) Declare _attachPoints in constructor() rather than buildRendering() so that DTL, which overrides buildRendering(), works again. Problem started in [20248] (refs #9966).

Thanks to ID and danstefan for the fix. Fixes #10612, #10526 !strict.

Note: See TracTickets for help on using tickets.