[_] Javascript removeChild and event listeners
Pete Fairhurst
pete at markedup.co.uk
Mon Oct 2 12:25:01 BST 2006
On 02/10/06, Iwein Dekoninck <iwein at 3sixty.co.uk> wrote:
>
> Quick question: removing a child node, does this also remove any event
> listeners defined on said child or children of said child? Or is it wise
> to remove any event listeners before removing said child to prevent
> memory leaks?
Sounds like a 'garbage collection' issue to me -- a concept which I think it
alien to JavaScript. So probably best if you do clean things up manually
before removing the node.
Someone please correct me if I'm wrong, though.
- Pete F.
_______________________________________________________________
"My favourite definition of luck is 'preparedness meets
opportunity'." -Peter Hirschmann, VP of Development [LucasArts]
_______________________________________________________________
>
> Quick question: removing a child node, does this also remove any event
> listeners defined on said child or children of said child? Or is it wise
> to remove any event listeners before removing said child to prevent
> memory leaks?
Sounds like a 'garbage collection' issue to me -- a concept which I think it
alien to JavaScript. So probably best if you do clean things up manually
before removing the node.
Someone please correct me if I'm wrong, though.
- Pete F.
_______________________________________________________________
"My favourite definition of luck is 'preparedness meets
opportunity'." -Peter Hirschmann, VP of Development [LucasArts]
_______________________________________________________________