diff --git a/src/vs/workbench/contrib/debug/browser/callStackWidget.ts b/src/vs/workbench/contrib/debug/browser/callStackWidget.ts index ff61c059012..42e4cbebafe 100644 --- a/src/vs/workbench/contrib/debug/browser/callStackWidget.ts +++ b/src/vs/workbench/contrib/debug/browser/callStackWidget.ts @@ -167,8 +167,9 @@ export class CallStackWidget extends Disposable { public setFrames(frames: AnyStackFrame[]): void { // cancel any existing load this.currentFramesDs.clear(); - this.cts = new CancellationTokenSource(); - this._register(toDisposable(() => this.cts!.dispose(true))); + const cts = new CancellationTokenSource(); + this.currentFramesDs.add(toDisposable(() => cts.dispose(true))); + this.cts = cts; this.list.splice(0, this.list.length, this.mapFrames(frames)); }