Skip to content

Commit c655326

Browse files
committed
Clear Diff Widget model before disposing the model
1 parent 214bf83 commit c655326

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,6 +1815,10 @@ export class ModifiedElement extends AbstractElementRenderer {
18151815
}
18161816

18171817
override dispose() {
1818+
// The editor isn't disposed yet, it can be re-used.
1819+
// However the model can be disposed before the editor & that causes issues.
1820+
this._editor!.setModel(null);
1821+
18181822
if (this._editor && this._editorViewStateChanged) {
18191823
this.cell.saveSpirceEditorViewState(this._editor.saveViewState());
18201824
}

0 commit comments

Comments
 (0)