Skip to content
Permalink
Browse files

Clearing event handlers on unload is no longer necessary in any versi…

…on of IE. This issue causing memory leaks between pages was fixed in MS07-033.
  • Loading branch information...
csnover committed Dec 26, 2010
1 parent a939ade commit 37d297c67fe3569a5a9d81586e14d4a887df7879
Showing with 0 additions and 17 deletions.
  1. +0 −17 src/event.js
@@ -1177,21 +1177,4 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl
}
});

// Prevent memory leaks in IE
// Window isn't included so as not to unbind existing unload events
// More info:
// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
if ( window.attachEvent && !window.addEventListener ) {
jQuery(window).bind("unload", function() {
for ( var id in jQuery.cache ) {
if ( jQuery.cache[ id ].handle ) {
// Try/Catch is to handle iframes being unloaded, see #4280
try {
jQuery.event.remove( jQuery.cache[ id ].handle.elem );
} catch(e) {}
}
}
});
}

})( jQuery );

0 comments on commit 37d297c

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