2011/4/28 Allex <[email protected]>:
> Thanks a lot :)
>
> clearfy a lot now, still noticed in some codes, such as base2.js, when
> there is a node reference variable. we can do it like this:
>
> function getNode() {
>  var node = ..; // get a HTMLElement reference.
>
>  // do some thing, e.g, bind event etc,.
>
>  // then we can destroy it as (but may be just need it in IE):
>  try {
>    return node;
>  } finally { node = null; }
> }

In some certain cases circular references can occur, most notably  in
older versions of Internet Explorer.  This is in cases where an object
is bind to a native element and vice-versa. This can create a circular
reference, which can result in a memory leak.

-- 
Poetro

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to