Skip to content

Commit

Permalink
fix(cloud-image-editor): little memory leak where cloud image editor …
Browse files Browse the repository at this point in the history
…was holding some references that prevents from context destroying
  • Loading branch information
nd0ut committed Aug 7, 2024
1 parent ef663fa commit 70a9b2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions abstract/Block.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ export class Block extends BaseComponent {

/** @protected */
destroyCallback() {
super.destroyCallback();

let blocksRegistry = this.blocksRegistry;
blocksRegistry?.delete(this);

Expand Down
1 change: 1 addition & 0 deletions blocks/CloudImageEditor/src/elements/slider/SliderUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export class SliderUi extends Block {
}

destroyCallback() {
super.destroyCallback();
this._observer?.disconnect();
}
}
Expand Down

0 comments on commit 70a9b2b

Please sign in to comment.