From: Chandler Carruth Date: Thu, 3 Nov 2016 17:42:32 +0000 (+0000) Subject: Using release to free memory is at best confusing -- one would expect X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=695a41c5a9deec30a843a3e7d4bc3eb83f49488f;p=clang Using release to free memory is at best confusing -- one would expect that its result is in fact used. Instead, use reset. This was pointed out by PVS-Studio. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285946 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/VerifyDiagnosticConsumer.cpp b/lib/Frontend/VerifyDiagnosticConsumer.cpp index 7331d77d1c..57ea9a0f8b 100644 --- a/lib/Frontend/VerifyDiagnosticConsumer.cpp +++ b/lib/Frontend/VerifyDiagnosticConsumer.cpp @@ -43,7 +43,7 @@ VerifyDiagnosticConsumer::~VerifyDiagnosticConsumer() { assert(!CurrentPreprocessor && "CurrentPreprocessor should be invalid!"); SrcManager = nullptr; CheckDiagnostics(); - Diags.takeClient().release(); + Diags.takeClient().reset(); } #ifndef NDEBUG