From f6386a4c473df18b784d48e41c26e145317ac680 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 22 Apr 2009 00:16:53 +0000 Subject: [PATCH] BUGFIX: Explicitly destroy TinyMCE instances when loading a new page, in an attempt to reduce memory leaks git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@74924 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/LeftAndMain_right.js | 31 ++++++++++++++++++++++--------- javascript/ReportAdmin_right.js | 8 +++----- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/javascript/LeftAndMain_right.js b/javascript/LeftAndMain_right.js index 43389f48..973564bb 100755 --- a/javascript/LeftAndMain_right.js +++ b/javascript/LeftAndMain_right.js @@ -39,11 +39,9 @@ CMSForm.prototype = { */ closeIfSetTo: function(id) { if(this.elements.ID && this.elements.ID.value == id) { - this.innerHTML = "

" + ss.i18n._t('LeftAndMain.PAGEWASDELETED') + "

"; // Note: TinyMCE coupling - if((typeof tinymce != 'undefined') && tinymce.EditorManager) { - tinymce.EditorManager.editors = {}; - } + tinymce_removeAll(); + this.innerHTML = "

" + ss.i18n._t('LeftAndMain.PAGEWASDELETED') + "

"; } }, @@ -87,6 +85,9 @@ CMSForm.prototype = { // Rewrite iframe links (for IE) rightHTML = rightHTML.replace(/(]*src=")([^"]+)("[^>]*>)/g, '$1' + baseHref() + '$2$3'); + // Note: TinyMCE coupling + tinymce_removeAll(); + // Prepare iframes for removal, otherwise we get loading bugs var i, allIframes = this.getElementsByTagName('iframe'); if(allIframes) for(i=0;i