summaryrefslogtreecommitdiffstats
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
commit05c562f0942721e7efaf7321dda2df80e31965c7 (patch)
tree56ecc6c7de6e5ad8ca28aad11eb6db0fcd88993a
parent2f31b33f34f569d180ab5848d0c5581c9e1f74ee (diff)
downloadbcm5719-llvm-05c562f0942721e7efaf7321dda2df80e31965c7.tar.gz
bcm5719-llvm-05c562f0942721e7efaf7321dda2df80e31965c7.zip
The MCJITMemoryManager takes ownership of the JMM, so don't leak it.
llvm-svn: 142410
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h b/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
index 40bc031a077..c17a39736cc 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
+++ b/llvm/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
OpenPOWER on IntegriCloud