mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 08:53:57 +00:00
while resolving an editor input it might get disposed
This commit is contained in:
parent
52f633d19c
commit
1f1db8515e
1 changed files with 8 additions and 9 deletions
|
@ -160,11 +160,12 @@ ${patterns}
|
|||
|
||||
if (!this._textModel) {
|
||||
this._textModel = await this._notebookModelResolverService.resolve(this.resource, this.viewType!);
|
||||
|
||||
this._register(this._textModel.object.onDidChangeDirty(() => {
|
||||
this._onDidChangeDirty.fire();
|
||||
}));
|
||||
|
||||
if (this.isDisposed()) {
|
||||
this._textModel.dispose();
|
||||
this._textModel = null;
|
||||
return null;
|
||||
}
|
||||
this._register(this._textModel.object.onDidChangeDirty(() => this._onDidChangeDirty.fire()));
|
||||
if (this._textModel.object.isDirty()) {
|
||||
this._onDidChangeDirty.fire();
|
||||
}
|
||||
|
@ -185,10 +186,8 @@ ${patterns}
|
|||
}
|
||||
|
||||
dispose() {
|
||||
if (this._textModel) {
|
||||
this._textModel.dispose();
|
||||
this._textModel = null;
|
||||
}
|
||||
this._textModel?.dispose();
|
||||
this._textModel = null;
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue