Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit d8fd301

Browse files
committed
Debugger: ignore "Process was terminated" error when trying to terminate the process.
1 parent 1c1e655 commit d8fd301

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/AddIns/Debugger/Debugger.Core/Process.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,16 @@ public void AsyncTerminate()
527527
System.Threading.Thread.Sleep(0);
528528

529529
// Stop&terminate - both must be called
530-
corProcess.Stop(uint.MaxValue);
531-
corProcess.Terminate(0);
530+
try {
531+
corProcess.Stop(uint.MaxValue);
532+
corProcess.Terminate(0);
533+
} catch (COMException ex) {
534+
if (ex.ErrorCode == unchecked((int)0x80131301)) {
535+
// COMException (0x80131301): Process was terminated.
536+
} else {
537+
throw;
538+
}
539+
}
532540
this.TerminateCommandIssued = true;
533541

534542
// Do not mark the process as exited

0 commit comments

Comments
 (0)