Selaa lähdekoodia

Prevent memory leaks of UI components.

Maciej Gołaszewski 7 vuotta sitten
vanhempi
sitoutus
4b7213d256
1 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  1. 10 0
      packages/ckeditor5-link/src/linkui.js

+ 10 - 0
packages/ckeditor5-link/src/linkui.js

@@ -75,6 +75,16 @@ export default class LinkUI extends Plugin {
 		this._enableUserBalloonInteractions();
 	}
 
+	/**
+	 * @inheritDoc
+	 */
+	destroy() {
+		super.destroy();
+
+		// Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
+		this.formView.destroy();
+	}
+
 	/**
 	 * Creates the {@link module:link/ui/linkactionsview~LinkActionsView} instance.
 	 *