Skip to content

Commit c059291

Browse files
authored
Merge pull request microsoft#226583 from microsoft/don/issue225207
Clear Diff Widget model before disposing the model
2 parents 1a0f603 + 3dcffc4 commit c059291

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/vs/workbench/contrib/notebook/browser/diff/diffComponents.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,6 +1825,12 @@ export class ModifiedElement extends AbstractElementRenderer {
18251825
}
18261826

18271827
override dispose() {
1828+
// The editor isn't disposed yet, it can be re-used.
1829+
// However the model can be disposed before the editor & that causes issues.
1830+
if (this._editor) {
1831+
this._editor.setModel(null);
1832+
}
1833+
18281834
if (this._editor && this._editorViewStateChanged) {
18291835
this.cell.saveSpirceEditorViewState(this._editor.saveViewState());
18301836
}

0 commit comments

Comments
 (0)