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 884de15fb970affd0b1697245795bce7b231a1db
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/event.js
@@ -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

This comment has been minimized.

Copy link
Contributor

replied Oct 11, 2010

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

This comment has been minimized.

Copy link
Member Author

replied Oct 11, 2010

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

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