From a33c2c3757763b9975a427a09289bd97b1fd9799 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Wed, 31 Mar 2021 17:28:18 +0800 Subject: [PATCH] Fix Utils.SHA256CheckSum file handle not closed --- Netch/Utils/Utils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Netch/Utils/Utils.cs b/Netch/Utils/Utils.cs index 3b11746a..2c1fad08 100644 --- a/Netch/Utils/Utils.cs +++ b/Netch/Utils/Utils.cs @@ -105,7 +105,7 @@ namespace Netch.Utils try { var sha256 = SHA256.Create(); - var fileStream = File.OpenRead(filePath); + using var fileStream = File.OpenRead(filePath); return sha256.ComputeHash(fileStream).Aggregate(string.Empty, (current, b) => current + b.ToString("x2")); } catch