Dispose the module.

Thanks to brson for noticing it.
This commit is contained in:
Rafael Ávila de Espíndola 2011-04-22 12:01:45 -04:00
parent 106f783b33
commit 9eb1479746
2 changed files with 2 additions and 0 deletions

View file

@ -7066,6 +7066,7 @@ fn run_passes(ModuleRef llmod, bool opt, bool verify, str output,
_str.buf(x86.get_target_triple()),
_str.buf(output),
FileType);
llvm.LLVMDisposeModule(llmod);
ret;
}

View file

@ -70,5 +70,6 @@ extern "C" void LLVMRustWriteOutputFile(LLVMPassManagerRef PMR, LLVMModuleRef M,
bool foo = Target.addPassesToEmitFile(*PM, FOS, FileType2, OLvl, NoVerify);
assert(!foo);
(void)foo;
PM->run(*unwrap(M));
}