aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-04-06 20:49:21 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-04-06 20:49:21 +0000
commit59d5f83b32753b3c9d5defa4d1374f7c9042eb46 (patch)
treeeb8b8953a818130db853bbad7f1b7338034d73ad /examples
parent63c3ffc16ae0dd6254b43e8a90e319df6e8b2440 (diff)
fix (part of) memory leak on shutdown. See PR2975.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r--examples/HowToUseJIT/HowToUseJIT.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/HowToUseJIT/HowToUseJIT.cpp b/examples/HowToUseJIT/HowToUseJIT.cpp
index 0482df6248..b5c6d11191 100644
--- a/examples/HowToUseJIT/HowToUseJIT.cpp
+++ b/examples/HowToUseJIT/HowToUseJIT.cpp
@@ -42,6 +42,7 @@
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/ExecutionEngine/Interpreter.h"
#include "llvm/ExecutionEngine/GenericValue.h"
+#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@ -109,5 +110,8 @@ int main() {
// Import result of execution:
outs() << "Result: " << gv.IntVal << "\n";
+ EE->freeMachineCodeForFunction(FooF);
+ delete EE;
+ llvm_shutdown();
return 0;
}