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

Prevent memory leaks of UI components.

Maciej Gołaszewski 7 лет назад
Родитель
Сommit
772e1043ac
1 измененных файлов с 12 добавлено и 0 удалено
  1. 12 0
      packages/ckeditor5-ui/src/toolbar/block/blocktoolbar.js

+ 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}.
 	 *