diff options
author | Jim Ingham <jingham@apple.com> | 2013-07-31 02:19:15 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2013-07-31 02:19:15 +0000 |
commit | 56d404281f8f94dd2d1915b91111e8db8e90e857 (patch) | |
tree | 672f744f93e4a61bf5d5028bfc5a335231454fe1 /lldb/source/Core/Disassembler.cpp | |
parent | 75a5ba7ed046d0c69db712406e646ef11b9e52a3 (diff) | |
download | bcm5719-llvm-56d404281f8f94dd2d1915b91111e8db8e90e857.tar.gz bcm5719-llvm-56d404281f8f94dd2d1915b91111e8db8e90e857.zip |
The DisassemblerLLVMC has a retain cycle - the InstructionLLVMC's contained in its instruction
list have a shared pointer back to their DisassemblerLLVMC. This checkin force clears the InstructionList
in all the places we use the DisassemblerSP to stop the leaking for now. I'll go back and fix this
for real when I have time to do so.
<rdar://problem/14581918>
llvm-svn: 187473
Diffstat (limited to 'lldb/source/Core/Disassembler.cpp')
-rw-r--r-- | lldb/source/Core/Disassembler.cpp | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp index fd0cae6a135..e80e92c91b5 100644 --- a/lldb/source/Core/Disassembler.cpp +++ b/lldb/source/Core/Disassembler.cpp @@ -316,14 +316,19 @@ Disassembler::Disassemble if (bytes_disassembled == 0) return false; - return PrintInstructions (disasm_sp.get(), - debugger, - arch, - exe_ctx, - num_instructions, - num_mixed_context_lines, - options, - strm); + bool result = PrintInstructions (disasm_sp.get(), + debugger, + arch, + exe_ctx, + num_instructions, + num_mixed_context_lines, + options, + strm); + + // FIXME: The DisassemblerLLVMC has a reference cycle and won't go away if it has any active instructions. + // I'll fix that but for now, just clear the list and it will go away nicely. + disasm_sp->GetInstructionList().Clear(); + return result; } } return false; @@ -361,14 +366,19 @@ Disassembler::Disassemble prefer_file_cache); if (bytes_disassembled == 0) return false; - return PrintInstructions (disasm_sp.get(), - debugger, - arch, - exe_ctx, - num_instructions, - num_mixed_context_lines, - options, - strm); + bool result = PrintInstructions (disasm_sp.get(), + debugger, + arch, + exe_ctx, + num_instructions, + num_mixed_context_lines, + options, + strm); + + // FIXME: The DisassemblerLLVMC has a reference cycle and won't go away if it has any active instructions. + // I'll fix that but for now, just clear the list and it will go away nicely. + disasm_sp->GetInstructionList().Clear(); + return result; } } return false; |