[cfe-commits] r154739 - /cfe/trunk/lib/Frontend/ASTUnit.cpp

Benjamin Kramer benny.kra at googlemail.com
Sat Apr 14 02:11:56 PDT 2012


Author: d0k
Date: Sat Apr 14 04:11:56 2012
New Revision: 154739

URL: http://llvm.org/viewvc/llvm-project?rev=154739&view=rev
Log:
ASTUnit: Don't clone the new DiagnosticConsumer, causing it to get leaked.

Modified:
    cfe/trunk/lib/Frontend/ASTUnit.cpp

Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=154739&r1=154738&r2=154739&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Sat Apr 14 04:11:56 2012
@@ -643,8 +643,10 @@
     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));
   }





More information about the cfe-commits mailing list