From d8fd301d251c738540d67588467bb9143b09d4cb Mon Sep 17 00:00:00 2001 From: Daniel Grunwald <daniel@danielgrunwald.de> Date: Sun, 22 Jun 2014 15:33:25 +0200 Subject: [PATCH] Debugger: ignore "Process was terminated" error when trying to terminate the process. --- src/AddIns/Debugger/Debugger.Core/Process.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/AddIns/Debugger/Debugger.Core/Process.cs b/src/AddIns/Debugger/Debugger.Core/Process.cs index 6ebdeee737..da2cc09f06 100644 --- a/src/AddIns/Debugger/Debugger.Core/Process.cs +++ b/src/AddIns/Debugger/Debugger.Core/Process.cs @@ -527,8 +527,16 @@ namespace Debugger System.Threading.Thread.Sleep(0); // Stop&terminate - both must be called - corProcess.Stop(uint.MaxValue); - corProcess.Terminate(0); + try { + corProcess.Stop(uint.MaxValue); + corProcess.Terminate(0); + } catch (COMException ex) { + if (ex.ErrorCode == unchecked((int)0x80131301)) { + // COMException (0x80131301): Process was terminated. + } else { + throw; + } + } this.TerminateCommandIssued = true; // Do not mark the process as exited