]> source.dussan.org Git - jquery.git/commitdiff
Clear elements to avoid leaking memory. Close gh-837. Fixes #11809
authorRichard Gibson <richard.gibson@gmail.com>
Tue, 26 Jun 2012 18:49:56 +0000 (14:49 -0400)
committerRick Waldron <waldron.rick@gmail.com>
Tue, 26 Jun 2012 18:49:56 +0000 (14:49 -0400)
src/manipulation.js

index 3c64105c0eb4a7f6b5cfcc7fa3dfb54fddc5685e..ffd6437f08ede877cb9361f7e25be0d24d7fef5a 100644 (file)
@@ -341,6 +341,9 @@ jQuery.fn.extend({
                                }
                        }
 
+                       // Fix #11809: Avoid leaking memory
+                       fragment = first = null;
+
                        if ( scripts.length ) {
                                jQuery.each( scripts, function( i, elem ) {
                                        if ( elem.src ) {
@@ -708,7 +711,7 @@ jQuery.extend({
                // Fix #11356: Clear elements from safeFragment
                if ( div ) {
                        safe.removeChild( div );
-                       div = safe = null;
+                       elem = div = safe = null;
                }
 
                // Reset defaultChecked for any radios and checkboxes