Hi all, Dave Methvin was on the spot. Nulling prevObject reclaimed the memory. That's a sneaky one, I bet lots of people get bit. Is there any real need for prevObject?
In case anyone is interested: http://jsbin.com/omuge#leak http://jsbin.com/omuge Thanks a lot Dave and Már - I'll save your plugin for the future :) cheers ricardo On 1 out, 19:28, Már <[email protected]> wrote: > > OK, here's my guess. Since the .clone() does a pushStack and selects > > the clones, there's a reference to $el hiding in the $clone.prevObject > > property so it won't be garbage-collected even if $el is nulled later. > > And for that very reason I once wrote this tiny plugin > > jQuery.fn.fin = function() { return jQuery(this); }; > > that I sneak into my command chains whenever I fear the stack is > getting too long, and I indend to keep a reference to that jQuery > collection for a while. > > -- > Már --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---
