Hi,
According to scriptmon, a tool I got directly from Microsoft to spot out memory leak problems coming from Javascript code, there is a leak in the following code. This leak seems to be true since I can experience my browser freezing after some loading and unloading of the FCK editor. I am then forced to kill my browser to come back to a normal behavior.
Could you have a look at it ?
According to scriptmon, a tool I got directly from Microsoft to spot out memory leak problems coming from Javascript code, there is a leak in the following code. This leak seems to be true since I can experience my browser freezing after some loading and unloading of the FCK editor. I am then forced to kill my browser to come back to a normal behavior.
Could you have a look at it ?
window.onload = function()
{
InitializeAPI()
if ( FCKBrowserInfo.IsIE )
FCK_PreloadImages()
else
LoadToolbarSetup()
}
function LoadToolbarSetup()
{
FCKeditorAPI._FunctionQueue.Add( LoadToolbar )
}
function LoadToolbar()
{
var oToolbarSet = FCK.ToolbarSet = FCKToolbarSet_Create()
if ( oToolbarSet.IsLoaded )
StartEditor()
else
{
oToolbarSet.OnLoad = StartEditor
oToolbarSet.Load( FCKURLParams['Toolbar'] || 'Default' )
}
}
function StartEditor()
{
// Remove the onload listener.
FCK.ToolbarSet.OnLoad = null
FCKeditorAPI._FunctionQueue.Remove( LoadToolbar )
FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive )
// Start the editor.
FCK.StartEditor()
}
[color=#FF0000]function WaitForActive( editorInstance, newStatus )
{
if ( newStatus == FCK_STATUS_ACTIVE )
{
if ( FCKBrowserInfo.IsGecko )
FCKTools.RunFunction( window.onresize )
if ( !FCKConfig.PreventSubmitHandler )
_AttachFormSubmitToAPI()
FCK.SetStatus( FCK_STATUS_COMPLETE )
// Call the special "FCKeditor_OnComplete" function that should be present in
// the HTML page where the editor is located.
if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' )
window.parent.FCKeditor_OnComplete( FCK )
}
} [/color]
// Gecko browsers doesn't calculate well the IFRAME size so we must
// recalculate it every time the window size changes.
if ( FCKBrowserInfo.IsGecko && !FCKBrowserInfo.IsOpera )
{
window.onresize = function( e )
{
// Running in Chrome makes the window receive the event including subframes.
// we care only about this window. Ticket #1642.
// #2002: The originalTarget from the event can be the current document, the window, or the editing area.
if ( e && e.originalTarget !== document && e.originalTarget !== window && (!e.originalTarget.ownerDocument || e.originalTarget.ownerDocument != document ))
return
var oCell = document.getElementById( 'xEditingArea' )
var eInnerElement = oCell.firstChild
if ( eInnerElement )
{
eInnerElement.style.height = '0px'
eInnerElement.style.height = ( oCell.scrollHeight - 2 ) + 'px'
}
}
} 
Re: FCK 2.6.3 and IE6 memory leak
window.onload = function() { InitializeAPI() ; if ( FCKBrowserInfo.IsIE ) FCK_PreloadImages() ; else LoadToolbarSetup() ; }Still trying to find the problem...