summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 54c17488c85..5d9fc9567dc 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -98,7 +98,9 @@ Preprocessor::~Preprocessor() {
Macros.begin(), E = Macros.end(); I != E; ++I) {
// We don't need to free the MacroInfo objects directly. These
// will be released when the BumpPtrAllocator 'BP' object gets
- // destroyed.
+ // destroyed. We still need to run the dstor, however, to free
+ // memory alocated by MacroInfo.
+ I->second->~MacroInfo();
I->first->setHasMacroDefinition(false);
}
OpenPOWER on IntegriCloud