[leaks] Fix a leak recently introduced to the pragma handling. This
whole code would be better with std::unique_ptr managing the lifetimes of the handlers, but I wanted to make a targeted fix to the leaks first. With this change, all of the Clang preprocessor tests are leak free with LSan. llvm-svn: 207872
This commit is contained in:
parent
6dd9f8feb3
commit
4d9c3df429
|
@ -1403,6 +1403,7 @@ void Preprocessor::IgnorePragmas() {
|
||||||
"Invalid namespace, registered as a regular pragma handler!");
|
"Invalid namespace, registered as a regular pragma handler!");
|
||||||
if (PragmaHandler *Existing = STDCNamespace->FindHandler("", false)) {
|
if (PragmaHandler *Existing = STDCNamespace->FindHandler("", false)) {
|
||||||
RemovePragmaHandler("STDC", Existing);
|
RemovePragmaHandler("STDC", Existing);
|
||||||
|
delete Existing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AddPragmaHandler("STDC", new EmptyPragmaHandler());
|
AddPragmaHandler("STDC", new EmptyPragmaHandler());
|
||||||
|
|
Loading…
Reference in New Issue