8
0
Эх сурвалжийг харах

Prevent memory leaks of UI components.

Maciej Gołaszewski 7 жил өмнө
parent
commit
772e1043ac

+ 12 - 0
packages/ckeditor5-ui/src/toolbar/block/blocktoolbar.js

@@ -150,6 +150,18 @@ export default class BlockToolbar extends Plugin {
 		}
 	}
 
+	/**
+	 * @inheritDoc
+	 */
+	destroy() {
+		super.destroy();
+
+		// Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
+		this.panelView.destroy();
+		this.buttonView.destroy();
+		this.toolbarView.destroy();
+	}
+
 	/**
 	 * Creates the {@link #toolbarView}.
 	 *