X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Fckeditor.js;h=068da319af4279fba61ae8036cada66e1b701713;hp=1faddd2dc191ba7c4cb00f160d5a4972cf9bc4a8;hb=8665a7c6c60586526e32e8941fe2896739b6ebfb;hpb=e7789c1ad838194d45eeee6ac2eb6e55f5cf35a1 diff --git a/_source/core/ckeditor.js b/_source/core/ckeditor.js index 1faddd2..068da31 100644 --- a/_source/core/ckeditor.js +++ b/_source/core/ckeditor.js @@ -69,6 +69,16 @@ CKEDITOR.remove = function( editor ) delete CKEDITOR.instances[ editor.name ]; }; +/** + * Perform global clean up to free as much memory as possible + * when there are no instances left + */ +CKEDITOR.on( 'instanceDestroyed', function () + { + if ( CKEDITOR.tools.isEmpty( this.instances ) ) + CKEDITOR.fire( 'reset' ); + }); + // Load the bootstrap script. CKEDITOR.loader.load( 'core/_bootstrap' ); // @Packager.RemoveLine