[thelist] JS memory leak detection?

VOLKAN ÖZÇELİK volkan.ozcelik at gmail.com
Mon Oct 24 06:11:24 CDT 2005


> function myFunc(){
> > var obj=document.getElementById("somenode");
> > var innerFunction=function(){
> > }
> > obj=null;
> > }
> >
>
>
> Well, in this particular case, obj should be garbage collected in any case.
> With or without obj being set to null, because you haven't created a
> circular reference. If you had obj.onmouseover=innerFunction there, or some
> similar code to create a circular reference, setting obj to null would break
> the circular reference and thereby allow the objects to be garbage
> collected.
>
>

That's my mistake. I should have written obj.onclick=innerFunction
because I was trying to demonstrate the circular reference thing.

Thank you for your help.
--
Volkan Ozcelik
+>Yep! I'm blogging! : http://www.volkanozcelik.com/volkanozcelik/blog/
+> My projects/studies/trials/errors : http://www.sarmal.com/



More information about the thelist mailing list