Fix a memory leak of PragmaNamespaces, rdar://10611796.

llvm-svn: 147635
This commit is contained in:
Argyrios Kyrtzidis 2012-01-06 00:22:09 +00:00
parent ae920b69f5
commit 7ce752610f
1 changed files with 3 additions and 1 deletions

View File

@ -714,8 +714,10 @@ void Preprocessor::RemovePragmaHandler(StringRef Namespace,
// If this is a non-default namespace and it is now empty, remove
// it.
if (NS != PragmaHandlers && NS->IsEmpty())
if (NS != PragmaHandlers && NS->IsEmpty()) {
PragmaHandlers->RemovePragmaHandler(NS);
delete NS;
}
}
bool Preprocessor::LexOnOffSwitch(tok::OnOffSwitch &Result) {