Skip to content

Commit 638eeb0

Browse files
authored
fix: Added missing Dispose() call to HashCode.cs.
1 parent ee0587e commit 638eeb0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • src/CommunityToolkit.Mvvm.SourceGenerators/Helpers

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 (var 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)