Commit 884de15f authored by jeresig's avatar jeresig

Make sure that the unload event doesn't leak in IE - use jQuery's binding...

Make sure that the unload event doesn't leak in IE - use jQuery's binding mechanism to make that happen.
parent bb0b9b89
...@@ -1154,7 +1154,7 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl ...@@ -1154,7 +1154,7 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl
// More info: // More info:
// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ // - http://isaacschlueter.com/2006/10/msie-memory-leaks/
if ( window.attachEvent && !window.addEventListener ) { if ( window.attachEvent && !window.addEventListener ) {
window.attachEvent("onunload", function() { jQuery(window).bind("unload", function() {
for ( var id in jQuery.cache ) { for ( var id in jQuery.cache ) {
if ( jQuery.cache[ id ].handle ) { if ( jQuery.cache[ id ].handle ) {
// Try/Catch is to handle iframes being unloaded, see #4280 // Try/Catch is to handle iframes being unloaded, see #4280
......
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