diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/LTO/LTOCodeGenerator.cpp | 5 | ||||
-rw-r--r-- | lib/Linker/LinkModules.cpp | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/LTO/LTOCodeGenerator.cpp b/lib/LTO/LTOCodeGenerator.cpp index e35e336..88f6061 100644 --- a/lib/LTO/LTOCodeGenerator.cpp +++ b/lib/LTO/LTOCodeGenerator.cpp @@ -66,7 +66,10 @@ LTOCodeGenerator::LTOCodeGenerator() LTOCodeGenerator::~LTOCodeGenerator() { delete TargetMach; delete NativeObjectFile; - delete Linker.getModule(); + TargetMach = NULL; + NativeObjectFile = NULL; + + Linker.deleteModule(); for (std::vector<char *>::iterator I = CodegenOptions.begin(), E = CodegenOptions.end(); diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index b343b1c..8f2200e 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -1352,6 +1352,11 @@ Linker::Linker(Module *M) : Composite(M) { Linker::~Linker() { } +void Linker::deleteModule() { + delete Composite; + Composite = NULL; +} + bool Linker::linkInModule(Module *Src, unsigned Mode, std::string *ErrorMsg) { ModuleLinker TheLinker(Composite, IdentifiedStructTypes, Src, Mode); if (TheLinker.run()) { |