Fix a leak I noticed while reviewing the accelerator table changes. Passes
authorEric Christopher <echristo@apple.com>
Fri, 6 Jan 2012 19:35:04 +0000 (19:35 +0000)
committerEric Christopher <echristo@apple.com>
Fri, 6 Jan 2012 19:35:04 +0000 (19:35 +0000)
lldb testsuite.

rdar://10652330

llvm-svn: 147673

llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp

index 940592e..370d42a 100644 (file)
@@ -51,6 +51,11 @@ DwarfAccelTable::DwarfAccelTable(std::vector<DwarfAccelTable::Atom> &atomList) :
 DwarfAccelTable::~DwarfAccelTable() {
   for (size_t i = 0, e = Data.size(); i < e; ++i)
     delete Data[i];
+  for (StringMap<DataArray>::iterator
+         EI = Entries.begin(), EE = Entries.end(); EI != EE; ++EI)
+    for (DataArray::iterator DI = (*EI).second.begin(),
+           DE = (*EI).second.end(); DI != DE; ++DI)
+      delete (*DI);
 }
 
 void DwarfAccelTable::AddName(StringRef Name, DIE* die, char Flags) {