]> granicus.if.org Git - clang/commitdiff
Run destructors of MacroInfo objects to free memory they allocate. This addresses...
authorTed Kremenek <kremenek@apple.com>
Mon, 19 Jan 2009 07:45:44 +0000 (07:45 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 19 Jan 2009 07:45:44 +0000 (07:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62498 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Preprocessor.cpp

index 54c17488c85f0d794bffa29c655ac65e68f2c3ec..5d9fc9567dc990e783ce908af9dccf4998eb344c 100644 (file)
@@ -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);
   }