From ed6499fe64d43252200d9ca40ba698de63616432 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Fri, 25 Apr 2014 23:55:12 +0000 Subject: Free the strong reference to a lldb::SBDebugger that the script interpreter was holding onto in the "lldb.debugger" global variable. llvm-svn: 207292 --- lldb/source/Interpreter/ScriptInterpreterPython.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index d85ec6429eea..eb2e33b9f456 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -1779,6 +1779,17 @@ ScriptInterpreterPython::GetScriptedSummary (const char *python_function_name, } +void +ScriptInterpreterPython::Clear () +{ + // Release any global variables that might have strong references to + // LLDB objects when clearing the python script interpreter. + Locker locker(this, + ScriptInterpreterPython::Locker::AcquireLock, + ScriptInterpreterPython::Locker::FreeAcquiredLock); + PyRun_SimpleString("lldb.debugger = None; lldb.target = None; lldb.process = None; lldb.thread = None; lldb.frame = None"); +} + bool ScriptInterpreterPython::BreakpointCallbackFunction ( -- cgit v1.2.3