소스 검색

Merge pull request #270 from ckeditor/t/ckeditor5/1341

Fix: There should be no memory leaks when the editor is created and destroyed (see ckeditor/ckeditor5#1341).
Aleksander Nowodzinski 7 년 전
부모
커밋
32c012b1bb
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js

+ 10 - 0
packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js

@@ -39,6 +39,16 @@ export default class ImageTextAlternativeUI extends Plugin {
 		this._createForm();
 	}
 
+	/**
+	 * @inheritDoc
+	 */
+	destroy() {
+		super.destroy();
+
+		// Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
+		this._form.destroy();
+	}
+
 	/**
 	 * Creates a button showing the balloon panel for changing the image text alternative and
 	 * registers it in the editor {@link module:ui/componentfactory~ComponentFactory ComponentFactory}.