Skip to content

Commit 7ec9495

Browse files
authored
Merge pull request #631 from HavenDV/patch-1
fix: Added missing Dispose() call to HashCode.cs.
2 parents 974e819 + e571eb3 commit 7ec9495

File tree

1 file changed

+5
-2
lines changed
  • src/CommunityToolkit.Mvvm.SourceGenerators/Helpers

1 file changed

+5
-2
lines changed

src/CommunityToolkit.Mvvm.SourceGenerators/Helpers/HashCode.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ private static unsafe uint GenerateGlobalSeed()
3535
{
3636
byte[] bytes = new byte[4];
3737

38-
RandomNumberGenerator.Create().GetBytes(bytes);
38+
using (RandomNumberGenerator generator = RandomNumberGenerator.Create())
39+
{
40+
generator.GetBytes(bytes);
41+
}
3942

4043
return BitConverter.ToUInt32(bytes, 0);
4144
}
@@ -182,4 +185,4 @@ private static uint RotateLeft(uint value, int offset)
182185
{
183186
return (value << offset) | (value >> (32 - offset));
184187
}
185-
}
188+
}

0 commit comments

Comments
 (0)