|
Using closures for information hiding in a JavaScript object that uses only JavaScript native objects doesn't pose a memory leak risk. Memory leaks are not inherent in using closures.
The IE memory leaks have three pre-conditions:
1.) IE,
2.) a circular reference (which may be created by a closure),
3.) a host object implemented as a COM object.
It's not closures that are the problem but the way that COM based host objects are garbage collected by IE.
I recently wrote about closures on my blog:
http://jrdodds.blogs.com/blog/2006/05/javascript_clos.html
|