JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2.2
[ckeditor.git] / _source / core / ckeditor.js
index 1faddd2..068da31 100644 (file)
@@ -69,6 +69,16 @@ CKEDITOR.remove = function( editor )
        delete CKEDITOR.instances[ editor.name ];\r
 };\r
 \r
+/**\r
+ * Perform global clean up to free as much memory as possible\r
+ * when there are no instances left\r
+ */\r
+CKEDITOR.on( 'instanceDestroyed', function ()\r
+       {\r
+               if ( CKEDITOR.tools.isEmpty( this.instances ) )\r
+                       CKEDITOR.fire( 'reset' );\r
+       });\r
+\r
 // Load the bootstrap script.\r
 CKEDITOR.loader.load( 'core/_bootstrap' );             // @Packager.RemoveLine\r
 \r