diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-01-19 07:45:44 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-01-19 07:45:44 +0000 |
commit | 9ee7d456b427e002f7fe1844b64bec8055c8db52 (patch) | |
tree | d0088f395c86a04b07b774b21f495f77ce2f9094 /lib/Lex/Preprocessor.cpp | |
parent | 2fa3ec888a980bf09e3d68435e227d3c4280bf70 (diff) |
Run destructors of MacroInfo objects to free memory they allocate. This addresses <rdar://problem/6506035>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62498 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 54c17488c8..5d9fc9567d 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/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); } |