fix: clear note change listener on editor vie deinit

This commit is contained in:
Baptiste Grob
2020-06-01 18:37:26 +02:00
parent d2af65c337
commit 36d8b81d2f
2 changed files with 5 additions and 0 deletions

View File

@@ -82,6 +82,10 @@ export class Editor {
} }
} }
public clearNoteChangeListener() {
this._onNoteChange = undefined;
}
/** /**
* Register to be notified when the editor's note's values change * Register to be notified when the editor's note's values change
* (and thus a new object reference is created) * (and thus a new object reference is created)

View File

@@ -144,6 +144,7 @@ class EditorViewCtrl extends PureViewCtrl implements EditorViewScope {
} }
deinit() { deinit() {
this.editor.clearNoteChangeListener();
this.removeTagsObserver(); this.removeTagsObserver();
this.removeComponentsObserver(); this.removeComponentsObserver();
(this.removeTagsObserver as any) = undefined; (this.removeTagsObserver as any) = undefined;