Changeset 1265

Show
Ignore:
Timestamp:
2008-01-03 08:39:00 (2 years ago)
Author:
martinkou
Message:

Fixed a slow but steady memory leak in the fckdialog manual memory leak test that appeared after [1529].

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/branches/features/floating_dialog/editor/fckdialog.html

    r1262 r1265  
    515515}() ; 
    516516 
     517// readystatechange handler for registering drag and drop handlers in cover iframes, defined out here to avoid memory leak. 
     518// Do NOT put this function inside Main() as a private function as it will induce memory leak in IE and it's not detectable 
     519// with Drip or sIEve and undetectable leaks are really nasty (sigh). 
     520var onReadyRegister = function() 
     521{ 
     522        if ( this.readyState != 'complete' ) 
     523                return ; 
     524        DragAndDrop.RegisterHandlers( this.contentWindow ) ; 
     525} 
     526 
    517527// The business logic of the dialog, dealing with operational things like dialog open/dialog close/enable/disable/etc. 
    518528var Main = function() 
     
    521531        if ( window.addEventListener ) 
    522532        { 
     533                // Keep a reference to the editor since Editor() doesn't work when the iframe is unloading. 
    523534                var editorRef = Editor() ; 
    524535                window.addEventListener( 'unload', function(){ editorRef.FCKFocusManager.Unlock() ; }, false ) ; 
    525536        } 
    526537 
    527  
    528         // readystatechange handler for registering drag and drop handlers in cover iframes, defined out here to avoid memory leak. 
    529         var onReadyRegister = function() 
    530         { 
    531                 if ( this.readyState != 'complete' ) 
    532                         return ; 
    533                 DragAndDrop.RegisterHandlers( this.contentWindow ) ; 
    534         } 
    535538 
    536539        var setOnKeyDown = function( targetDocument )