[Lldb-commits] [lldb] r233258 - Fix Process::Finalize to do Process::Destroy if needed after r233255

Ilia K ki.stfu at gmail.com
Thu Mar 26 00:40:40 PDT 2015


Author: ki.stfu
Date: Thu Mar 26 02:40:40 2015
New Revision: 233258

URL: http://llvm.org/viewvc/llvm-project?rev=233258&view=rev
Log:
Fix Process::Finalize to do Process::Destroy if needed after r233255


Modified:
    lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=233258&r1=233257&r2=233258&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Thu Mar 26 02:40:40 2015
@@ -822,8 +822,26 @@ Process::GetGlobalProperties()
 void
 Process::Finalize()
 {
-    // Destroy this process
-    Destroy();
+    // Destroy this process if needed
+    switch (GetPrivateState())
+    {
+        case eStateConnected:
+        case eStateAttaching:
+        case eStateLaunching:
+        case eStateStopped:
+        case eStateRunning:
+        case eStateStepping:
+        case eStateCrashed:
+        case eStateSuspended:
+            Destroy();
+            break;
+            
+        case eStateInvalid:
+        case eStateUnloaded:
+        case eStateDetached:
+        case eStateExited:
+            break;
+    }
 
     // Clear our broadcaster before we proceed with destroying
     Broadcaster::Clear();





More information about the lldb-commits mailing list