Commit 37d297c6 authored by Colin Snover's avatar Colin Snover

Clearing event handlers on unload is no longer necessary in any version of IE....

Clearing event handlers on unload is no longer necessary in any version of IE. This issue causing memory leaks between pages was fixed in MS07-033.
parent a939ade9
...@@ -1177,21 +1177,4 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl ...@@ -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 ); })( jQuery );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment