fix leakage of CXXSpecialName objects in DeclarationNameTable

llvm-svn: 61007
This commit is contained in:
Nuno Lopes 2008-12-14 17:27:25 +00:00
parent f312dc7729
commit 127adb4462
1 changed files with 10 additions and 1 deletions

View File

@ -259,7 +259,16 @@ DeclarationNameTable::DeclarationNameTable() {
}
DeclarationNameTable::~DeclarationNameTable() {
delete static_cast<llvm::FoldingSet<CXXSpecialName>*>(CXXSpecialNamesImpl);
llvm::FoldingSet<CXXSpecialName> *set =
static_cast<llvm::FoldingSet<CXXSpecialName>*>(CXXSpecialNamesImpl);
llvm::FoldingSetIterator<CXXSpecialName> it = set->begin();
while (it != set->end()) {
CXXSpecialName *n = &*it++;
delete n;
}
delete set;
delete [] CXXOperatorNames;
}