I guess this example wouldn't work as-is with jQuery? For example with
the mem-leak test, the elements causing the leak would already be
leaked by dialog("destroy")-calls by the time the page unloads and
thus would not get cleaned up by this script?

Regards,
Janne


On 30 huhti, 11:05, Andrea Giammarchi <[email protected]>
wrote:
> Maybe this post could 
> help?http://webreflection.blogspot.com/2009/04/drip-under-control-via-anot...
>
> the short version:
> if(this.attachEvent)attachEvent("onunload",function(){function
> d(n,a,l){if(a=n.attributes){l=a.length;while(l)n.removeAttribute(a[--l].name);};while(n[c])d(n[c]);if(n[p])n[p].removeChild(n);};var
> c="lastChild",p="parentNode";d(document.documentElement);});
>
> Regards
>
> 2009/4/30 Janne Kytömäki <[email protected]>
>
>
>
> > Thanks Brandon for the quick work on this. I updated the dialog-leak-
> > test athttp://linux.kytomaki.com/jqtest/to include jquery r6323, but
> > unfortunately the event.remove fix doesn't seem to correct this
> > problem: IE7 and IE8 continue to leak memory in more or less the same
> > fashion as described in
> >http://groups.google.com/group/jquery-dev/browse_thread/thread/df7f91...
> > .
> > :-(
>
> > Regards,
> > Janne
>
> > On 30 huhti, 01:22, DBJDBJ <[email protected]> wrote:
> > > Thanks B,
>
> > > I was wondering :
>
> > >http://linux.kytomaki.com/jqtest/.
>
> > > Might this help for testing ?
>
> > > --DBJ
>
> > > On Apr 29, 10:49 pm, Brandon Aaron <[email protected]> wrote:
>
> > > > I've fixed the issue with jQuery.event.remove not unbinding namespaced
> > > > events but had a very difficult time getting reliable results when
> > testing
> > > > the memory leak. Please test r6321 and let me know if this fixes the
> > memory
> > > > leak for you.
> > > > --
> > > > Brandon Aaron
>
> > > > On Sat, Apr 25, 2009 at 3:09 PM, Mike Park <[email protected]> wrote:
>
> > > > > new thread, as requested (original message below):
> > > > > -------
>
> > > > > There is definitely a problem with the way jQuery (I'm using 1.3.2)
> > > > > handles cleaning up namespaced events (I'm tracing the 'unload' event
> > > > > codepath). The problem from what I can tell seems to be in
> > > > > jQuery.event.remove:
>
> > > > > 2540         // Handle multiple events seperated by a space
> > > > > 2541         // jQuery(...).unbind("mouseover mouseout", fn);
> > > > > 2542         jQuery.each(types.split(/\s+/), function(index, type){
> > > > > 2543           // Namespaced event handlers
> > > > > 2544           var namespaces = type.split(".");
> > > > > 2545           type = namespaces.shift();
> > > > > 2546           var namespace = RegExp("(^|\\.)" + namespaces.slice
> > > > > ().sort().join(".*\\.") +      "(\\.|$)");
>
> > > > > ...during the 'unload' event-handler codepath, this code snippet here
> > > > > is expecting the passed in 'types' argument to contain the namespaced
> > > > > event-identifier (ex. 'click.foo'), but instead it is getting the
> > > > > common event-identifier instead (ex. 'click').
>
> > > > > You can firebug-trace this yourselves with the simple examples I put
> > > > > up here:
> > > > >  http://emparq.com/ex/ex-good.html
> > > > >  http://emparq.com/ex/ex-bad.html
>
> > > > > ...you'll notice the only difference between these two examples is
> > > > > that one binds 'click.foo' and the other binds 'click'. In the bad
> > > > > example, hitting reload constantly will see the process memory useage
> > > > > go up (in essense, a leak) due to 'jQuery.event.remove' not properly
> > > > > cleaning up the namespaced 'click.foo' event), while the good example
> > > > > will not suffer the same results.
>
> > > > > I'm still new-ish to jQuery and I'm not ready to hazard a solution
> > > > > just yet, but I'm guessing something either needs to be done with the
> > > > > way 'jQuery.event.remove' handles the value of the 'types' argument,
> > > > > or this code here:
>
> > > > > 2531         for ( var type in events )
> > > > > 2532           this.remove( elem, type + (types || "") );
>
> > > > > ...needs to be modified to properly put those namespaced suffixes
> > back
> > > > > into the second argument. I'm not familiar enough with all of the
> > use-
> > > > > cases that this function handles, so I don't know which is the best
> > > > > approach.
>
> > > > > Can anyone else shed some light on this subject?
>
> > > > > --Mike- Hide quoted text -
>
> > > > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to