Skip to content

Commit 23860e9

Browse files
authored
dispose saved text model with wrong view type (microsoft#209461)
1 parent fb7f833 commit 23860e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ export class InteractiveEditorInput extends EditorInput implements ICompositeNot
209209
return undefined; // save cancelled
210210
}
211211

212-
return await this._editorModelReference.saveAs(target);
212+
const saved = await this._editorModelReference.saveAs(target);
213+
if (saved && 'resource' in saved && saved.resource) {
214+
this._notebookService.getNotebookTextModel(saved.resource)?.dispose();
215+
}
216+
return saved;
213217
}
214218

215219
override matches(otherInput: EditorInput | IUntypedEditorInput): boolean {

0 commit comments

Comments
 (0)