Make sure the CallFunction Thread plans don't try to do DoTakedown if their thread
has gone  away by the time they get around to doing it.

<rdar://problem/15245544>

llvm-svn: 192987
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 1e33565..df0c143 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -282,12 +282,18 @@
 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();