ovyalov created this revision. ovyalov added a reviewer: clayborg. ovyalov added a subscriber: lldb-commits.
Python locks in memory a few global objects like lldb.debugger,lldb.target,... - as a consequence, ~Debugger isn't called upon shutdown. Calling Debugger::Clear ensures that ScriptInterpreterPython::Clear is called to clean up Python global variables. http://reviews.llvm.org/D12683 Files: source/Core/Debugger.cpp Index: source/Core/Debugger.cpp =================================================================== --- source/Core/Debugger.cpp +++ source/Core/Debugger.cpp @@ -421,7 +421,11 @@ // Clear our master list of debugger objects Mutex::Locker locker (GetDebuggerListMutex ()); - GetDebuggerList().clear(); + auto& debuggers = GetDebuggerList(); + for (const auto& debugger: debuggers) + debugger->Clear(); + + debuggers.clear(); } void
Index: source/Core/Debugger.cpp =================================================================== --- source/Core/Debugger.cpp +++ source/Core/Debugger.cpp @@ -421,7 +421,11 @@ // Clear our master list of debugger objects Mutex::Locker locker (GetDebuggerListMutex ()); - GetDebuggerList().clear(); + auto& debuggers = GetDebuggerList(); + for (const auto& debugger: debuggers) + debugger->Clear(); + + debuggers.clear(); } void
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits