From 5bcf0a6e6dc42b925fb798aa176c13be8f14d927 Mon Sep 17 00:00:00 2001 From: Gregg Miskelly Date: Fri, 26 Feb 2016 17:42:54 -0800 Subject: [PATCH] DbgShim!RegisterForRuntimeStartup: Avoid extra call to callback If the target process exits, and the debugger notifies dbgshim by calling Unregister then dbgshim was calling back into the callback to let it know that it couldn't enumerate modules. With this fix, dbgshim no longer invokes the call back on errors at the end if unregister has already been called. --- src/dlls/dbgshim/dbgshim.cpp | 2 +- src/pal/src/thread/process.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dlls/dbgshim/dbgshim.cpp b/src/dlls/dbgshim/dbgshim.cpp index efd3e1f..7f683f3 100644 --- a/src/dlls/dbgshim/dbgshim.cpp +++ b/src/dlls/dbgshim/dbgshim.cpp @@ -436,7 +436,7 @@ public: } } - if (FAILED(hr)) + if (FAILED(hr) && !m_canceled) { m_callback(NULL, m_parameter, hr); } diff --git a/src/pal/src/thread/process.cpp b/src/pal/src/thread/process.cpp index a520ea6..314b991 100644 --- a/src/pal/src/thread/process.cpp +++ b/src/pal/src/thread/process.cpp @@ -1668,7 +1668,7 @@ public: } } - if (pe != NO_ERROR) + if (pe != NO_ERROR && !m_canceled) { SetLastError(pe); m_callback(NULL, NULL, m_parameter); -- 2.7.4