More information about the Underscore mailing list

[_] Javascript removeChild and event listeners

Tom Gidden tom at gidden.net
Mon Oct 2 14:37:53 BST 2006

On 2 Oct 2006, at 14:12, Jan Grant wrote:


> JS can also clean up circular references.
>
> If the JS interpreter is embedded in a platform that doesn't release
> references to JS objects correctly, then that's a bug in the
> containing
> platform. That's quite likely to be the case, I'd expect, since JS
> event
> handlers are probably registered with the containing browser through a
> proxy that keeps a reference to the JS in question.

Yeah, sorry.. should have been more specific. Some current
implementations of JS (in particular, Microsoft's) don't tend to
clean up certain types of circular reference.

Googling comes up with:

http://jibbering.com/faq/faq_notes/closures.html#clMem
and
http://blog.metawrap.com/blog/IEClosuresLeaks.aspx

That second link has some useful ideas to do with scrubbing out
problematic references which could be adapted.

Tom

--
Tom Gidden
http://gidden.net/tom/