Fix CA2216

This commit is contained in:
RoosterDragon
2023-03-13 18:31:04 +00:00
committed by abcdefg30
parent a120b9d37e
commit f470f9ab91
3 changed files with 25 additions and 5 deletions

View File

@@ -45,6 +45,12 @@ namespace OpenRA.Platforms.Default
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
void Dispose(bool _)
{
if (Cursor != IntPtr.Zero)
{
@@ -58,5 +64,10 @@ namespace OpenRA.Platforms.Default
surface = IntPtr.Zero;
}
}
~Sdl2HardwareCursor()
{
Dispose(false);
}
}
}