From: Benjamin Kramer Date: Sat, 14 Apr 2012 09:11:56 +0000 (+0000) Subject: ASTUnit: Don't clone the new DiagnosticConsumer, causing it to get leaked. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bcadf96a75942f528fc0683d953d66589d341909;p=clang ASTUnit: Don't clone the new DiagnosticConsumer, causing it to get leaked. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154739 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index e32fa630a7..7aa96032ee 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -643,8 +643,10 @@ void ASTUnit::ConfigureDiags(IntrusiveRefCntPtr &Diags, DiagnosticConsumer *Client = 0; if (CaptureDiagnostics) Client = new StoredDiagnosticConsumer(AST.StoredDiagnostics); - Diags = CompilerInstance::createDiagnostics(DiagOpts, ArgEnd- ArgBegin, - ArgBegin, Client); + Diags = CompilerInstance::createDiagnostics(DiagOpts, ArgEnd-ArgBegin, + ArgBegin, Client, + /*ShouldOwnClient=*/true, + /*ShouldCloneClient=*/false); } else if (CaptureDiagnostics) { Diags->setClient(new StoredDiagnosticConsumer(AST.StoredDiagnostics)); }