DbgShim!RegisterForRuntimeStartup: Avoid extra call to callback
authorGregg Miskelly <greggm@microsoft.com>
Sat, 27 Feb 2016 01:42:54 +0000 (17:42 -0800)
committerGregg Miskelly <greggm@microsoft.com>
Sat, 27 Feb 2016 02:02:34 +0000 (18:02 -0800)
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
src/pal/src/thread/process.cpp

index efd3e1f..7f683f3 100644 (file)
@@ -436,7 +436,7 @@ public:
             }
         }
 
-        if (FAILED(hr))
+        if (FAILED(hr) && !m_canceled)
         {
             m_callback(NULL, m_parameter, hr);
         }
index a520ea6..314b991 100644 (file)
@@ -1668,7 +1668,7 @@ public:
             }
         }
 
-        if (pe != NO_ERROR)
+        if (pe != NO_ERROR && !m_canceled)
         {
             SetLastError(pe);
             m_callback(NULL, NULL, m_parameter);