Skip to content
Permalink
Browse files
Make sure that the unload event doesn't leak in IE - use jQuery's bin…
…ding mechanism to make that happen.
  • Loading branch information
jeresig committed Oct 10, 2010
1 parent bb0b9b8 commit 884de15
Showing 1 changed file with 1 addition and 1 deletion.
@@ -1154,7 +1154,7 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl
// More info:
// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
if ( window.attachEvent && !window.addEventListener ) {
window.attachEvent("onunload", function() {
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

2 comments on commit 884de15

@jitter
Copy link
Contributor

@jitter jitter commented on 884de15 Oct 11, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the testswarm environment for IE6/7 e.g. http://swarm.jquery.org/job/321/

The tests seem to run fine but at the very end of every test it says ERROR: Object doesn't support this action and every test-module is shown as failed

This could be related to http://github.com/jquery/jquery/pull/41

@jeresig
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - that was related, I just landed a variation of it. Thanks for the catch!

Please sign in to comment.