Commit 0c9195c6 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

Remove additional current process tracking in backtrace_all as it can

refer to freed memory.
parent 04a8cff1
......@@ -209,17 +209,13 @@ static void backtrace_all(void)
entry.dwSize = sizeof(entry);
if (Thread32First(snapshot, &entry))
{
struct dbg_process* cp = dbg_curr_process;
DWORD cpid = dbg_curr_pid;
do
{
if (entry.th32OwnerProcessID == GetCurrentProcessId()) continue;
if (dbg_curr_process && dbg_curr_pid != cpid)
if (dbg_curr_process && dbg_curr_pid != entry.th32OwnerProcessID)
dbg_detach_debuggee();
if (entry.th32OwnerProcessID == cpid)
dbg_curr_process = cp;
else if (entry.th32OwnerProcessID != dbg_curr_pid)
if (entry.th32OwnerProcessID != dbg_curr_pid)
{
if (!dbg_attach_debuggee(entry.th32OwnerProcessID, FALSE, TRUE))
{
......@@ -236,9 +232,8 @@ static void backtrace_all(void)
}
while (Thread32Next(snapshot, &entry));
if (dbg_curr_process && dbg_curr_pid != cpid)
if (dbg_curr_process)
dbg_detach_debuggee();
dbg_curr_process = cp; dbg_curr_pid = cpid;
}
CloseHandle(snapshot);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment