Fix Process::Finalize to do Process::Destroy if needed after r233255

llvm-svn: 233258
This commit is contained in:
Ilia K 2015-03-26 07:40:40 +00:00
parent fd3241528d
commit c7efd564bb
1 changed files with 20 additions and 2 deletions

View File

@ -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();