aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-10-18 19:57:38 +0000
committerJim Grosbach <grosbach@apple.com>2011-10-18 19:57:38 +0000
commit3326fc18c859d7988b90345b195d784cc39b3cf6 (patch)
treedb521ef98fac42ff2eeb6f5a85ec4de6e31a5145
parent7c24665390a79ee05a0a562ff689e52d4135063e (diff)
The MCJITMemoryManager takes ownership of the JMM, so don't leak it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142410 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h b/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
index 40bc031a07..c17a39736c 100644
--- a/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
+++ b/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
@@ -27,6 +27,8 @@ class MCJITMemoryManager : public RTDyldMemoryManager {
Module *M;
public:
MCJITMemoryManager(JITMemoryManager *jmm, Module *m) : JMM(jmm), M(m) {}
+ // We own the JMM, so make sure to delete it.
+ ~MCJITMemoryManager() { delete JMM; }
// Allocate ActualSize bytes, or more, for the named function. Return
// a pointer to the allocated memory and update Size to reflect how much