Skip to content

Commit

Permalink
After manual destruction, don't destroy again on model disposal
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Haines <andrew@haines.org.nz>
  • Loading branch information
haines committed Nov 2, 2023
1 parent 96a73c6 commit 7cecd51
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/y-monaco.js
Expand Up @@ -180,7 +180,7 @@ export class MonacoBinding {
}, this)
})
})
monacoModel.onWillDispose(() => {
this._monacoDisposeHandler = monacoModel.onWillDispose(() => {
this.destroy()
})
if (awareness) {
Expand Down Expand Up @@ -212,6 +212,7 @@ export class MonacoBinding {

destroy () {
this._monacoChangeHandler.dispose()
this._monacoDisposeHandler.dispose()
this.ytext.unobserve(this._ytextObserver)
this.doc.off('beforeAllTransactions', this._beforeTransaction)
if (this.awareness) {
Expand Down

0 comments on commit 7cecd51

Please sign in to comment.