From b6d02735e955523adcf88ff92b3bc7ecb144c624 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 26 Jun 2012 14:49:56 -0400 Subject: [PATCH] Clear elements to avoid leaking memory. Close gh-837. Fixes #11809 --- src/manipulation.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/manipulation.js b/src/manipulation.js index 3c64105c0..ffd6437f0 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -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 -- 2.39.5