Commit ad16fc9e authored by Alexandre Julliard's avatar Alexandre Julliard

Avoid crash when trying to attach to a terminating process.

parent 67157729
......@@ -539,9 +539,11 @@ void suspend_process( struct process *process )
if (!process->suspend++)
{
struct thread *thread = process->thread_list;
for (; thread; thread = thread->proc_next)
while (thread)
{
struct thread *next = thread->proc_next;
if (!thread->suspend) stop_thread( thread );
thread = next;
}
}
}
......@@ -553,9 +555,11 @@ void resume_process( struct process *process )
if (!--process->suspend)
{
struct thread *thread = process->thread_list;
for (; thread; thread = thread->proc_next)
while (thread)
{
struct thread *next = thread->proc_next;
if (!thread->suspend) continue_thread( thread );
thread = next;
}
}
}
......
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