Skip to content

Commit 7cecd51

Browse files
committed
After manual destruction, don't destroy again on model disposal
Signed-off-by: Andrew Haines <[email protected]>
1 parent 96a73c6 commit 7cecd51

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/y-monaco.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export class MonacoBinding {
180180
}, this)
181181
})
182182
})
183-
monacoModel.onWillDispose(() => {
183+
this._monacoDisposeHandler = monacoModel.onWillDispose(() => {
184184
this.destroy()
185185
})
186186
if (awareness) {
@@ -212,6 +212,7 @@ export class MonacoBinding {
212212

213213
destroy () {
214214
this._monacoChangeHandler.dispose()
215+
this._monacoDisposeHandler.dispose()
215216
this.ytext.unobserve(this._ytextObserver)
216217
this.doc.off('beforeAllTransactions', this._beforeTransaction)
217218
if (this.awareness) {

0 commit comments

Comments
 (0)