Fix an issue where certain CommandObjects (or Options thereof) were being created once, bound to a specific CommandInterpreter (and hence a specific Debugger), and then cached for reuse across different Debugger instances
Obviously, if the original Debugger goes away, those commands are holding on to now stale memory, which has the potential to cause crashes Fixes rdar://24460882 llvm-svn: 259964
This commit is contained in:
@@ -4167,12 +4167,7 @@ RenderScriptRuntime::RenderScriptRuntime(Process *process)
|
||||
lldb::CommandObjectSP
|
||||
RenderScriptRuntime::GetCommandObject(lldb_private::CommandInterpreter &interpreter)
|
||||
{
|
||||
static CommandObjectSP command_object;
|
||||
if (!command_object)
|
||||
{
|
||||
command_object.reset(new CommandObjectRenderScriptRuntime(interpreter));
|
||||
}
|
||||
return command_object;
|
||||
return CommandObjectSP(new CommandObjectRenderScriptRuntime(interpreter));
|
||||
}
|
||||
|
||||
RenderScriptRuntime::~RenderScriptRuntime() = default;
|
||||
|
||||
Reference in New Issue
Block a user