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

Commit

Permalink
Merge pull request #65 from ckeditor/t/ckeditor5/1341
Browse files Browse the repository at this point in the history
Fix: There should be no memory leaks when the editor is created and destroyed (see ckeditor/ckeditor5#1341).
  • Loading branch information
oleq authored Jan 22, 2019
2 parents b86a6d3 + 53129f6 commit 2e8f20d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/widgettoolbarrepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ export default class WidgetToolbarRepository extends Plugin {
}, { priority: 'low' } );
}

destroy() {
super.destroy();

for ( const toolbarConfig of this._toolbarDefinitions.values() ) {
toolbarConfig.view.destroy();
}
}

/**
* Registers toolbar in the WidgetToolbarRepository. It renders it in the `ContextualBalloon` based on the value of the invoked
* `getRelatedElement` function. Toolbar items are gathered from `items` array.
Expand Down

0 comments on commit 2e8f20d

Please sign in to comment.