8
0
Просмотр исходного кода

Improve editor destructuring process.

Maciej Gołaszewski 7 лет назад
Родитель
Сommit
e338206907

+ 9 - 0
packages/ckeditor5-core/src/editor/editor.js

@@ -278,6 +278,15 @@ export default class Editor {
 				this.data.destroy();
 				this.editing.destroy();
 				this.keystrokes.destroy();
+
+				// Fail-safe dereference of entities that may hold back reference to the editor - prevent memory leaks #1341
+				this.plugins = null;
+				this.commands = null;
+				this.model = null;
+				this.data = null;
+				this.editing = null;
+				this.keystrokes = null;
+				this.conversion = null;
 			} );
 	}
 

+ 1 - 0
packages/ckeditor5-core/src/editor/editorui.js

@@ -80,6 +80,7 @@ export default class EditorUI {
 	destroy() {
 		this.stopListening();
 		this.view.destroy();
+		this.focusTracker.destroy();
 	}
 
 	/**