forked from OSchip/llvm-project
Free the strong reference to a lldb::SBDebugger that the script interpreter was holding onto in the "lldb.debugger" global variable.
llvm-svn: 207292
This commit is contained in:
parent
363b570d2a
commit
ed6499fe64
|
@ -414,6 +414,12 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
virtual void
|
||||
Clear ()
|
||||
{
|
||||
// Clean up any ref counts to SBObjects that might be in global variables
|
||||
}
|
||||
|
||||
virtual size_t
|
||||
CalculateNumChildren (const lldb::ScriptInterpreterObjectSP& implementor)
|
||||
{
|
||||
|
|
|
@ -170,6 +170,9 @@ public:
|
|||
lldb::ScriptInterpreterObjectSP& callee_wrapper_sp,
|
||||
std::string& retval);
|
||||
|
||||
virtual void
|
||||
Clear ();
|
||||
|
||||
virtual bool
|
||||
GetDocumentationForItem (const char* item, std::string& dest);
|
||||
|
||||
|
|
|
@ -355,6 +355,9 @@ void
|
|||
CommandInterpreter::Clear()
|
||||
{
|
||||
m_command_io_handler_sp.reset();
|
||||
|
||||
if (m_script_interpreter_ap)
|
||||
m_script_interpreter_ap->Clear();
|
||||
}
|
||||
|
||||
const char *
|
||||
|
|
|
@ -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
|
||||
(
|
||||
|
|
Loading…
Reference in New Issue