]> source.dussan.org Git - jquery.git/commitdiff
Removed event test for load; Added fix for bug #225
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Sat, 30 Sep 2006 14:34:01 +0000 (14:34 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Sat, 30 Sep 2006 14:34:01 +0000 (14:34 +0000)
src/event/event.js

index ff1d936fd70bddbc5b19abbf2b9237cf506a9cb6..3610122a85b147e760d4cd715b9789c9ccc2f2ba 100644 (file)
@@ -1521,7 +1521,8 @@ new function(){
                 
                 /**
                  * @test var count;
-                 * var e = ("blur,focus,load,resize,scroll,unload,click,dblclick," +
+                 * // ignore load
+                 * var e = ("blur,focus,resize,scroll,unload,click,dblclick," +
                  *             "mousedown,mouseup,mousemove,mouseover,mouseout,change,reset,select," + 
                  *             "submit,keydown,keypress,keyup,error").split(",");
                  * var handler1 = function(event) {
@@ -1554,7 +1555,7 @@ new function(){
                  *     $(document)[event]();
                  *     
                  *     // assert count
-                 * @test ok( count == 6, 'Checking event ' + event);
+                 *     ok( count == 6, 'Checking event ' + event);
                  * }
                  *
                  * @private
@@ -1646,3 +1647,12 @@ new function(){
        jQuery.event.add( window, "load", jQuery.ready );
        
 };
+
+// Clean up after IE to avoid memory leaks
+if ($.browser.msie) $(window).unload(function() {
+       var event = jQuery.event, global = event.global;
+       for (var type in global) {
+               var els = global[type], i = els.length;
+               if (i>0) do event.remove(els[i-1], type); while (--i);
+       }
+});