Explorar el Código

Prevent memory leaks of UI components.

Maciej Gołaszewski hace 7 años
padre
commit
772e1043ac
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  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}.
 	 *