[llvm-commits] [llvm] r109745 - /llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
Benjamin Kramer
benny.kra at googlemail.com
Thu Jul 29 04:57:59 PDT 2010
Author: d0k
Date: Thu Jul 29 06:57:59 2010
New Revision: 109745
URL: http://llvm.org/viewvc/llvm-project?rev=109745&view=rev
Log:
COFFObjectWriter: Don't leak COFFSymbols and COFFSections.
Modified:
llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=109745&r1=109744&r2=109745&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Thu Jul 29 06:57:59 2010
@@ -131,6 +131,7 @@
symbol_map SymbolMap;
WinCOFFObjectWriter(raw_ostream &OS);
+ ~WinCOFFObjectWriter();
COFFSymbol *createSymbol(llvm::StringRef Name);
COFFSection *createSection(llvm::StringRef Name);
@@ -275,6 +276,13 @@
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);
}
More information about the llvm-commits
mailing list