r260850 - Don't leak the ASTUnit when done with testing.
Argyrios Kyrtzidis via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 14 09:18:27 PST 2016
Thanks!
> On Feb 14, 2016, at 5:18 AM, Benjamin Kramer via cfe-commits <cfe-commits at lists.llvm.org> wrote:
>
> Author: d0k
> Date: Sun Feb 14 07:18:06 2016
> New Revision: 260850
>
> URL: http://llvm.org/viewvc/llvm-project?rev=260850&view=rev
> Log:
> Don't leak the ASTUnit when done with testing.
>
> Found by lsan.
>
> Modified:
> cfe/trunk/tools/c-index-test/core_main.cpp
>
> Modified: cfe/trunk/tools/c-index-test/core_main.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/core_main.cpp?rev=260850&r1=260849&r2=260850&view=diff
> ==============================================================================
> --- cfe/trunk/tools/c-index-test/core_main.cpp (original)
> +++ cfe/trunk/tools/c-index-test/core_main.cpp Sun Feb 14 07:18:06 2016
> @@ -123,9 +123,8 @@ static bool printSourceSymbols(ArrayRef<
> /*WrappedAction=*/nullptr);
>
> auto PCHContainerOps = std::make_shared<PCHContainerOperations>();
> - ASTUnit *Unit =
> - ASTUnit::LoadFromCompilerInvocationAction(CInvok.get(), PCHContainerOps,
> - Diags, IndexAction.get());
> + std::unique_ptr<ASTUnit> Unit(ASTUnit::LoadFromCompilerInvocationAction(
> + CInvok.get(), PCHContainerOps, Diags, IndexAction.get()));
>
> if (!Unit)
> return true;
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list