diff options
| author | Greg Clayton <gclayton@apple.com> | 2014-04-25 23:55:12 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2014-04-25 23:55:12 +0000 |
| commit | ed6499fe64d43252200d9ca40ba698de63616432 (patch) | |
| tree | a2b3bebf3dfb530c7b50582456dc4f3679aa8002 /lldb/source/Interpreter/ScriptInterpreterPython.cpp | |
| parent | 363b570d2a8b6bb4f1d921cbcd95b53ee3cf2a41 (diff) | |
Free the strong reference to a lldb::SBDebugger that the script interpreter was holding onto in the "lldb.debugger" global variable.
llvm-svn: 207292
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
| -rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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 ( |
