Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 2e8f20d

Browse files
authored
Merge pull request #65 from ckeditor/t/ckeditor5/1341
Fix: There should be no memory leaks when the editor is created and destroyed (see ckeditor/ckeditor5#1341).
2 parents b86a6d3 + 53129f6 commit 2e8f20d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/widgettoolbarrepository.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ export default class WidgetToolbarRepository extends Plugin {
9393
}, { priority: 'low' } );
9494
}
9595

96+
destroy() {
97+
super.destroy();
98+
99+
for ( const toolbarConfig of this._toolbarDefinitions.values() ) {
100+
toolbarConfig.view.destroy();
101+
}
102+
}
103+
96104
/**
97105
* Registers toolbar in the WidgetToolbarRepository. It renders it in the `ContextualBalloon` based on the value of the invoked
98106
* `getRelatedElement` function. Toolbar items are gathered from `items` array.

0 commit comments

Comments
 (0)