2010/12/25 Garrett Smith <[email protected]>:
>> In this case, I still have a memory leak?
> Yes, you do. But what are you doing there?

Alright. Now I'm not sure what the real code in Yu's head looks like,
but when I first read I thought he meant something like:

function outer() {
     var div = document.createElement("div");
     // do something with div
     // ...
     function inner() {
        var a,b,c;
        // do something without div
        // ...
     }
     outer = inner;
     return inner();
}

There is no leak in this case. The memory usage is stable
in IE for 10 000 calls: http://jsbin.com/oriqa4/

- Balázs

-- 
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