From 638eeb00fe79980520079599194f9285e0621588 Mon Sep 17 00:00:00 2001 From: Konstantin S Date: Thu, 9 Mar 2023 06:17:20 +1000 Subject: [PATCH] fix: Added missing Dispose() call to HashCode.cs. --- .../Helpers/HashCode.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CommunityToolkit.Mvvm.SourceGenerators/Helpers/HashCode.cs b/src/CommunityToolkit.Mvvm.SourceGenerators/Helpers/HashCode.cs index bd615271..a1a7a7d9 100644 --- a/src/CommunityToolkit.Mvvm.SourceGenerators/Helpers/HashCode.cs +++ b/src/CommunityToolkit.Mvvm.SourceGenerators/Helpers/HashCode.cs @@ -35,7 +35,10 @@ private static unsafe uint GenerateGlobalSeed() { byte[] bytes = new byte[4]; - RandomNumberGenerator.Create().GetBytes(bytes); + using (var generator = RandomNumberGenerator.Create()) + { + generator.GetBytes(bytes); + } return BitConverter.ToUInt32(bytes, 0); } @@ -182,4 +185,4 @@ private static uint RotateLeft(uint value, int offset) { return (value << offset) | (value >> (32 - offset)); } -} \ No newline at end of file +}