From 4c6ed904bf1715da92933e7a9b94da54a0d39ecc Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 18 Aug 2010 23:38:21 +0000 Subject: 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. llvm-svn: 111457 --- clang/lib/Frontend/ASTUnit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Frontend/ASTUnit.cpp') diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 28cdc529224..f6894044609 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/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, -- cgit v1.2.3