diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp index f97d3f9852b6..facf0e366aef 100644 --- a/lldb/source/API/SBDebugger.cpp +++ b/lldb/source/API/SBDebugger.cpp @@ -614,6 +614,7 @@ SBDebugger::DeleteTarget (lldb::SBTarget &target) { // No need to lock, the target list is thread safe result = m_opaque_sp->GetTargetList().DeleteTarget (target.m_opaque_sp); + target->Destroy(); target.Clear(); ModuleList::RemoveOrphanSharedModules(); }