From d2914f5b58db36e54e06f5d12e7ee2af86f0635e Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 26 Jun 2019 16:56:25 +0200 Subject: [PATCH] Remove all old threads which are no longer part of the update fixes #75980 --- src/vs/workbench/contrib/debug/browser/debugSession.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vs/workbench/contrib/debug/browser/debugSession.ts b/src/vs/workbench/contrib/debug/browser/debugSession.ts index a75db88dfc8..ca53f26dbf5 100644 --- a/src/vs/workbench/contrib/debug/browser/debugSession.ts +++ b/src/vs/workbench/contrib/debug/browser/debugSession.ts @@ -577,7 +577,9 @@ export class DebugSession implements IDebugSession { } rawUpdate(data: IRawModelUpdate): void { + const threadIds: number[] = []; data.threads.forEach(thread => { + threadIds.push(thread.id); if (!this.threads.has(thread.id)) { // A new thread came in, initialize it. this.threads.set(thread.id, new Thread(this, thread.name, thread.id)); @@ -589,6 +591,12 @@ export class DebugSession implements IDebugSession { } } }); + this.threads.forEach(t => { + // Remove all old threads which are no longer part of the update #75980 + if (threadIds.indexOf(t.threadId) === -1) { + this.threads.delete(t.threadId); + } + }); const stoppedDetails = data.stoppedDetails; if (stoppedDetails) { -- GitLab