Skip to content

Commit

Permalink
Cancel cell task when closing related cell doc (#5926)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne authored May 19, 2021
1 parent afddee1 commit 1f6c401
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions news/2 Fixes/5925.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Resolve issue related to `Interrupt` button vanishing when tabbing across notebooks while a cell is being executed.
10 changes: 5 additions & 5 deletions src/client/datascience/jupyter/kernels/cellExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ export class CellExecution {
// No point keeping it alive, just chewing resources.
if (e === this.cell.document) {
this.request?.dispose(); // NOSONAR
}
if (this.started && !this._completed) {
this.completedDueToCancellation().catch((ex) =>
traceInfo('Failures when cancelling due to cell removal', ex)
);
if (this.started && !this._completed) {
this.completedDueToCancellation().catch((ex) =>
traceInfo('Failures when cancelling due to cell removal', ex)
);
}
}
},
this,
Expand Down

0 comments on commit 1f6c401

Please sign in to comment.