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:
Enrico Granata committed 2016-02-06 00:43:07 +00:00
1 parent 304ccee528
commit 0a66e2f135
5 files changed
+79 -29

No files matched your search

@@ -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;