Skip to content
Permalink
Browse files

fix for #5198, event memory leak limited to IE only via conditional c…

…ompilation
  • Loading branch information
brandonaaron committed Sep 14, 2009
1 parent 4a3c4c8 commit f3474c00cd6d9e5fd61b6ef1562003e9986ad67d
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/event.js
@@ -776,11 +776,10 @@ jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
});

// Prevent memory leaks in IE
// And prevent errors on refresh with events like mouseover in other browsers
// Window isn't included so as not to unbind existing unload events
// More info:
// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
// - https://bugzilla.mozilla.org/show_bug.cgi?id=252542
/*@cc_on
jQuery( window ).bind( 'unload', function() {
for ( var id in jQuery.cache ) {
// Skip the window
@@ -789,3 +788,4 @@ jQuery( window ).bind( 'unload', function() {
}
}
});
@*/

4 comments on commit f3474c0

@steida

This comment has been minimized.

Copy link

@steida steida replied May 30, 2010

And that's how fairytale story about feature over browser detection ends :-)

@jdalton

This comment has been minimized.

Copy link
Member

@jdalton jdalton replied May 30, 2010

Don't be silly. That is old code. They have since replaced it with feature detection for IE's DOM API and test for the Firefox bug in a different way. By reworking the event system a bit they could make the event system not rely on unload for IE as well.

@steida

This comment has been minimized.

Copy link

@steida steida replied May 31, 2010

Really? I suppose unload event is necessary and feature undetectable as well.

@jdalton

This comment has been minimized.

Copy link
Member

@jdalton jdalton replied Jun 1, 2010

Unload is not necessary if the event system is tweaked a bit. Most libs use the unload event to cleanup memory leaks in IE6/7. Absent tweaking the event system to remove the need for unload they use DOM API inference to detect IE's non-standard event and use the unload event for it.

Please sign in to comment.
You can’t perform that action at this time.