[dojo-contributors] IE7 leaks and testBench

Scott J. Miles sjmiles at turboajax.com
Wed Aug 8 16:25:07 EDT 2007


So, it appears that IE7 still has a basic DOM-JS circular reference leak 
pattern. The variation in IE7 seems to be that it only occurs when the 
DOM node is not part of a document.

We see this problem in spades in testBench because the created widgets 
are attached to a temp node that is never attached to any document.

Inserting:

+65 document.body.appendChild(tmpNode);

into testBench makes the reported leaks go away (c.f. 
http://trac.dojotoolkit.org/ticket/3531 and 
http://trac.dojotoolkit.org/ticket/4046).

I'm not sure how often this happens in real life, so this may be less of 
a problem than it appears.

I would suggest that code that produces phantom nodes (and attaches 
events to them) should be responsible for making them go away (vs. 
trying to solve this in event code). Otoh, running the Dijit cleanup 
code in IE7 could provide a measure of blind protection (with some costs 
at unload-time).

I did some basic Googling, but I didn't find any reference to this 
problem specifically on IE7 (although I seem to be pretty bad at writing 
Google queries).

Regards,
Scott J. Miles
TurboAjax Group
http://www.turboajax.com



More information about the dojo-contributors mailing list