forked from OSchip/llvm-project
COFFObjectWriter: Don't leak COFFSymbols and COFFSections.
llvm-svn: 109745
This commit is contained in:
parent
eaeede9a06
commit
c2997dde85
|
@ -131,6 +131,7 @@ public:
|
|||
symbol_map SymbolMap;
|
||||
|
||||
WinCOFFObjectWriter(raw_ostream &OS);
|
||||
~WinCOFFObjectWriter();
|
||||
|
||||
COFFSymbol *createSymbol(llvm::StringRef Name);
|
||||
COFFSection *createSection(llvm::StringRef Name);
|
||||
|
@ -275,6 +276,13 @@ WinCOFFObjectWriter::WinCOFFObjectWriter(raw_ostream &OS)
|
|||
Header.Machine = 0x14C; // x86
|
||||
}
|
||||
|
||||
WinCOFFObjectWriter::~WinCOFFObjectWriter() {
|
||||
for (symbols::iterator I = Symbols.begin(), E = Symbols.end(); I != E; ++I)
|
||||
delete *I;
|
||||
for (sections::iterator I = Sections.begin(), E = Sections.end(); I != E; ++I)
|
||||
delete *I;
|
||||
}
|
||||
|
||||
COFFSymbol *WinCOFFObjectWriter::createSymbol(llvm::StringRef Name) {
|
||||
return createCOFFEntity<COFFSymbol>(Name, Symbols);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue