mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
use an autoptr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17875 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
90c18c5c69
commit
a4d0c6fb94
@ -195,18 +195,14 @@ bool llvm::LinkInArchive(Module *M,
|
||||
for (std::set<ModuleProvider*>::iterator I=Modules.begin(), E=Modules.end();
|
||||
I != E; ++I) {
|
||||
// Get the module we must link in.
|
||||
Module* aModule = (*I)->releaseModule();
|
||||
std::auto_ptr<Module> aModule((*I)->releaseModule());
|
||||
|
||||
// Link it in
|
||||
if (LinkModules(M, aModule, ErrorMessage)) {
|
||||
// Link it in.
|
||||
if (LinkModules(M, aModule.get(), ErrorMessage)) {
|
||||
// don't create a memory leak
|
||||
delete aModule;
|
||||
delete arch;
|
||||
return true; // Couldn't link in the right object file...
|
||||
}
|
||||
|
||||
// Since we have linked in this object, throw it away now.
|
||||
delete aModule;
|
||||
}
|
||||
|
||||
// We have linked in a set of modules determined by the archive to satisfy
|
||||
|
Loading…
Reference in New Issue
Block a user