Skip to content

Commit c753936

Browse files
authored
Fix possible leaks in notebook chat Editing component (microsoft#258379)
1 parent c915ea1 commit c753936

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export class ChatEditingModifiedNotebookEntry extends AbstractChatEditingModifie
226226
try {
227227
this._isProcessingResponse.set(true, undefined);
228228
const notebookDiff = await this.notebookEditorWorkerService.computeDiff(this.originalURI, this.modifiedURI);
229-
if (id !== this.computeRequestId) {
229+
if (id !== this.computeRequestId || this._store.isDisposed) {
230230
return;
231231
}
232232
const result = computeDiff(this.originalModel, this.modifiedModel, notebookDiff);
@@ -746,6 +746,9 @@ export class ChatEditingModifiedNotebookEntry extends AbstractChatEditingModifie
746746
return true;
747747
};
748748
this.resolveCellModel(cell.uri).then(modifiedModel => {
749+
if (this._store.isDisposed) {
750+
return;
751+
}
749752
// We want decorators for the cell just as we display decorators for modified cells.
750753
// This way we have the ability to accept/reject the entire cell.
751754
this.getOrCreateModifiedTextFileEntryForCell(cell, modifiedModel, originalModel);

0 commit comments

Comments
 (0)