From: Douglas Gregor Date: Wed, 18 Aug 2010 23:38:21 +0000 (+0000) Subject: When creating an ASTUnit by parsing source code, set DisableFree to X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f421089b73800066bbf43613c9a8422a96c1b0c3;p=clang When creating an ASTUnit by parsing source code, set DisableFree to 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 --- diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 28cdc52922..f689404460 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -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,