Closures Closures do not create leaks as default. Only closure functions having dom references that are not properly cleaned up will leak.
There are some good references about closures. See the Link "Closures for dummies" that says:
"a closure is the local variables for a function - kept alive after the function has returned" OR
"In JavaScript, if you use the function keyword inside another function, you are creating a closure."
LEAK Problems with closures occur ONLY in conjunction with circular references (JS > DOM > JS).
function test(){ var localVaribale....; var x = new function(){ modify localVaribale} }
The easiest way to prevent "closure leaks" is to move the "inner function" outside of the main function. Then you have to care only about any circular references. If you are an experiance programmer, you may use closures and remove any circular references without any problem.
function test(){ var localVaribale....; ModifyMe(localVaribale); } function ModifyMe(myVar){ Modify myVar; }