diff options
Diffstat (limited to 'lib/VMCore/LLVMContextImpl.cpp')
-rw-r--r-- | lib/VMCore/LLVMContextImpl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/VMCore/LLVMContextImpl.cpp b/lib/VMCore/LLVMContextImpl.cpp index 7ab3cce..de851ee 100644 --- a/lib/VMCore/LLVMContextImpl.cpp +++ b/lib/VMCore/LLVMContextImpl.cpp @@ -58,6 +58,8 @@ LLVMContextImpl::~LLVMContextImpl() { std::vector<Module*> Modules(OwnedModules.begin(), OwnedModules.end()); DeleteContainerPointers(Modules); + // Free the constants. This is important to do here to ensure that they are + // freed before the LeakDetector is torn down. std::for_each(ExprConstants.map_begin(), ExprConstants.map_end(), DropReferences()); std::for_each(ArrayConstants.map_begin(), ArrayConstants.map_end(), @@ -71,8 +73,8 @@ LLVMContextImpl::~LLVMContextImpl() { StructConstants.freeConstants(); VectorConstants.freeConstants(); CAZConstants.clear(); - NullPtrConstants.freeConstants(); - UndefValueConstants.freeConstants(); + CPNConstants.clear(); + UVConstants.clear(); InlineAsms.freeConstants(); DeleteContainerSeconds(IntConstants); DeleteContainerSeconds(FPConstants); |