diff --git a/blocks/CloudImageEditor/src/CloudImageEditorBlock.js b/blocks/CloudImageEditor/src/CloudImageEditorBlock.js index 9c094c300..c1a653984 100644 --- a/blocks/CloudImageEditor/src/CloudImageEditorBlock.js +++ b/blocks/CloudImageEditor/src/CloudImageEditorBlock.js @@ -16,6 +16,7 @@ import { parseTabs } from './lib/parseTabs.js'; import { initState } from './state.js'; import { TEMPLATE } from './template.js'; import { TabId } from './toolbar-constants.js'; +import { Data } from '@symbiotejs/symbiote'; export class CloudImageEditorBlock extends CloudImageEditorBase { static className = 'cloud-image-editor'; @@ -78,6 +79,13 @@ export class CloudImageEditorBlock extends CloudImageEditorBase { this.initEditor(); } + destroyCallback() { + super.destroyCallback(); + + // Destroy global editor's context + Data.deleteCtx(this.ctxName); + } + async updateImage() { await this._waitForSize();