Skip to content

Commit e571eb3

Browse files
HavenDVSergio0694
authored andcommitted
Add missing Dispose() call to HashCode
1 parent ee0587e commit e571eb3

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)