I've been using Drip 0.5 to try to check for DOM Leaks in IE6/7, and once thing I've noticed is that calls to .removeChild(..) actually seem to make DOM ref counts go up? Is this correct? Could it be that I'm removing an element that has children, and those children are then considered "leaks"?
It almost seems best to to do any .removeChild(..) calls (as a method of clean up anyway). To be sure... I can't really see why .removeChild(..) would help with cleaning up leaks anyway (but I'm a little puzzled that it seems to actually make matters worse).
Has anyone else experienced anything like this? Anyone have any insight?
removeChild(..) will only remove the element from the DOM tree but the elements are not actually freed and the reference to the removed child(s) will exist until page closes. This is a 'pseudo leak'. Solution for this is setting innerHTML="" instead of removeChild(). see: http://outofhanwell.com/ieleak/index.php?title=Fixing_Leaks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been using Drip 0.5 to try to check for DOM Leaks in IE6/7, and once thing I've noticed is that calls to .removeChild(..) actually seem to make DOM ref counts go up? Is this correct? Could it be that I'm removing an element that has children, and those children are then considered "leaks"?
It almost seems best to to do any .removeChild(..) calls (as a method of clean up anyway). To be sure... I can't really see why .removeChild(..) would help with cleaning up leaks anyway (but I'm a little puzzled that it seems to actually make matters worse).
Has anyone else experienced anything like this? Anyone have any insight?
Thanks,
Steve
http://ecmascript.stchur.com/
Hi Steve,
removeChild(..) will only remove the element from the DOM tree but the elements are not actually freed and the reference to the removed child(s) will exist until page closes. This is a 'pseudo leak'. Solution for this is setting innerHTML="" instead of removeChild(). see: http://outofhanwell.com/ieleak/index.php?title=Fixing_Leaks