X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fckeditor.js;h=068da319af4279fba61ae8036cada66e1b701713;hb=e371ddf8abcb89013e20e6d0dd746adec344d0e5;hp=1faddd2dc191ba7c4cb00f160d5a4972cf9bc4a8;hpb=c6e377a02b54abc07129d72b632763c727476a15;p=ckeditor.git 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