diff options
author | Jim Grosbach <grosbach@apple.com> | 2012-01-17 23:08:46 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2012-01-17 23:08:46 +0000 |
commit | 893f4864b34a84a88860035c7a21a5ee9560a530 (patch) | |
tree | b24e4f66a8d50e29c7d29fb02f2204d7c249dcf4 /lib/ExecutionEngine/MCJIT | |
parent | 0bd2ae92b0908f2e3b85eafb9ba48b9d6a82c774 (diff) |
Fix MCJIT memory leak of owned TargetMachine.
The JIT is expected to take ownership of the TM that's passed in. The MCJIT
wasn't freeing it, resulting in leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148356 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/MCJIT')
-rw-r--r-- | lib/ExecutionEngine/MCJIT/MCJIT.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp index d5aaec9333..a0280b7c79 100644 --- a/lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ b/lib/ExecutionEngine/MCJIT/MCJIT.cpp @@ -85,6 +85,7 @@ MCJIT::MCJIT(Module *m, TargetMachine *tm, TargetJITInfo &tji, MCJIT::~MCJIT() { delete MemMgr; + delete TM; } void *MCJIT::getPointerToBasicBlock(BasicBlock *BB) { |