From 42d33f2f86d48f5f82a640a6c57c566a4e84cdda Mon Sep 17 00:00:00 2001 From: Florian Gutmann Date: Fri, 14 Oct 2011 18:12:21 +0300 Subject: Dialog: fix small memory leak when having lot's of instances. Fixes #7793 - Small memory leak in ui dialog. --- ui/jquery.ui.dialog.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ui/jquery.ui.dialog.js') diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 065d640fb..46320426a 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -715,12 +715,11 @@ $.extend( $.ui.dialog.overlay, { $( window ).bind( "resize.dialog-overlay", $.ui.dialog.overlay.resize ); } - var $el = ( this.oldInstances.pop() || $( "
" ).addClass( "ui-widget-overlay" ) ) - .appendTo( document.body ) - .css({ - width: this.width(), - height: this.height() - }); + var $el = ( this.oldInstances.pop() || $( "
" ).addClass( "ui-widget-overlay" ) ); + $el.appendTo( document.body ).css({ + width: this.width(), + height: this.height() + }); if ( $.fn.bgiframe ) { $el.bgiframe(); -- cgit v1.2.3