From d8c871fa498e983fa154dc36e1c29f3eeeb5c7f0 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Fri, 7 Jun 2024 11:31:31 -0400 Subject: [PATCH] Dispose HttpClientHandler when done with it It is an IDisposable, and some static analysis tools complain that it doesn't get Dispose()d correctly. --- src/dotnet-sourcelink/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotnet-sourcelink/Program.cs b/src/dotnet-sourcelink/Program.cs index eba8e56d..e422d4cd 100644 --- a/src/dotnet-sourcelink/Program.cs +++ b/src/dotnet-sourcelink/Program.cs @@ -211,7 +211,7 @@ private async Task TestAsync(string path, AuthenticationHeaderValue? authen if (!offline) { - var handler = new HttpClientHandler(); + using var handler = new HttpClientHandler(); if (handler.SupportsAutomaticDecompression) handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;