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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207872
91177308-0d34-0410-b5e6-
96231b3b80d8
"Invalid namespace, registered as a regular pragma handler!");
if (PragmaHandler *Existing = STDCNamespace->FindHandler("", false)) {
RemovePragmaHandler("STDC", Existing);
+ delete Existing;
}
}
AddPragmaHandler("STDC", new EmptyPragmaHandler());