]> granicus.if.org Git - clang/commitdiff
When creating an ASTUnit by parsing source code, set DisableFree to
authorDouglas Gregor <dgregor@apple.com>
Wed, 18 Aug 2010 23:38:21 +0000 (23:38 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 18 Aug 2010 23:38:21 +0000 (23:38 +0000)
false (not true), so that the CompilerInstance will actually free data
structures when it's done. This fixes a major leak with libclang's
in-process code completion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111457 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/ASTUnit.cpp

index 28cdc5292241010481459c0fadf7eb90e162c05f..f68940446099385f03e7089ac56955d63754fab3 100644 (file)
@@ -1377,7 +1377,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin,
   // Override the resources path.
   CI->getHeaderSearchOpts().ResourceDir = ResourceFilesPath;
 
-  CI->getFrontendOpts().DisableFree = true;
+  CI->getFrontendOpts().DisableFree = false;
   return LoadFromCompilerInvocation(CI.take(), Diags, OnlyLocalDecls,
                                     CaptureDiagnostics, PrecompilePreamble,
                                     CompleteTranslationUnit,