I've known that using closure like this will cause memory leaks because all other variables does not released.
function()
{
var a = 0;
var b = 1;
sample_func( "123",function(){
console.log(b+1);
});
}
But how does this?
function()
{
var a = 0;
var b = 1;
rtn_func(b);
}
var rtn_func = function(b){
console.log(b+1);
}
Will passing variable to other functions as argument cause memory leak in Node.js?
Updated: after trn_func, will b auto-released?