After deleting a target, clear the target object and remove orphaned modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140843 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBDebugger.cpp b/source/API/SBDebugger.cpp
index 0f5472a..f97d3f9 100644
--- a/source/API/SBDebugger.cpp
+++ b/source/API/SBDebugger.cpp
@@ -614,6 +614,8 @@
{
// No need to lock, the target list is thread safe
result = m_opaque_sp->GetTargetList().DeleteTarget (target.m_opaque_sp);
+ target.Clear();
+ ModuleList::RemoveOrphanSharedModules();
}
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));