diff options
| -rw-r--r-- | lldb/include/lldb/Target/ThreadPlanCallFunction.h | 8 | ||||
| -rw-r--r-- | lldb/source/Target/Thread.cpp | 12 |
2 files changed, 16 insertions, 4 deletions
diff --git a/lldb/include/lldb/Target/ThreadPlanCallFunction.h b/lldb/include/lldb/Target/ThreadPlanCallFunction.h index d747706c639..7b8efb60b88 100644 --- a/lldb/include/lldb/Target/ThreadPlanCallFunction.h +++ b/lldb/include/lldb/Target/ThreadPlanCallFunction.h @@ -136,7 +136,13 @@ public: virtual bool RestoreThreadState(); - + + virtual void + ThreadDestroyed () + { + m_takedown_done = true; + } + protected: void ReportRegisterState (const char *message); diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 1e33565a4c5..df0c143db52 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -282,12 +282,18 @@ Thread::~Thread() void Thread::DestroyThread () { - // Tell any plans on the plan stack that the thread is being destroyed since - // any active plans that have a thread go away in the middle of might need - // to do cleanup. + // Tell any plans on the plan stacks that the thread is being destroyed since + // any plans that have a thread go away in the middle of might need + // to do cleanup, or in some cases NOT do cleanup... for (auto plan : m_plan_stack) plan->ThreadDestroyed(); + for (auto plan : m_discarded_plan_stack) + plan->ThreadDestroyed(); + + for (auto plan : m_completed_plan_stack) + plan->ThreadDestroyed(); + m_destroy_called = true; m_plan_stack.clear(); m_discarded_plan_stack.clear(); |

