@tiptap/core 2.7.3 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -4434,6 +4434,12 @@ class Editor extends EventEmitter {
4434
4434
  destroy() {
4435
4435
  this.emit('destroy');
4436
4436
  if (this.view) {
4437
+ // Cleanup our reference to prevent circular references which caused memory leaks
4438
+ // @ts-ignore
4439
+ const dom = this.view.dom;
4440
+ if (dom && dom.editor) {
4441
+ delete dom.editor;
4442
+ }
4437
4443
  this.view.destroy();
4438
4444
  }
4439
4445
  this.removeAllListeners();