Skip to content

Commit b6d0273

Browse files
gibson042rwaldron
authored andcommitted
Clear elements to avoid leaking memory. Close jquerygh-837. Fixes #11809
1 parent 7a9b57a commit b6d0273

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/manipulation.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,9 @@ jQuery.fn.extend({
341341
}
342342
}
343343

344+
// Fix #11809: Avoid leaking memory
345+
fragment = first = null;
346+
344347
if ( scripts.length ) {
345348
jQuery.each( scripts, function( i, elem ) {
346349
if ( elem.src ) {
@@ -708,7 +711,7 @@ jQuery.extend({
708711
// Fix #11356: Clear elements from safeFragment
709712
if ( div ) {
710713
safe.removeChild( div );
711-
div = safe = null;
714+
elem = div = safe = null;
712715
}
713716

714717
// Reset defaultChecked for any radios and checkboxes

0 commit comments

Comments
 (0)