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

T/ckeditor5/1341: Prevent memory leaks #65

Merged
merged 2 commits into from
Jan 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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