[SDL][Win] Destroy custom cursor on Close()

X11 destroys the cursor after setting it and Cocoa uses an autorelease
pool, so that should not be necessary there.
This commit is contained in:
thefiddler 2014-05-01 14:27:20 +02:00
parent c8c0d32fcc
commit 9988a2ba9c
2 changed files with 12 additions and 0 deletions

View file

@ -1057,6 +1057,12 @@ namespace OpenTK.Platform.SDL2
{ {
DestroyWindow(); DestroyWindow();
} }
if (sdl_cursor != IntPtr.Zero)
{
SDL.FreeCursor(sdl_cursor);
sdl_cursor = IntPtr.Zero;
}
} }
else else
{ {

View file

@ -1639,6 +1639,12 @@ namespace OpenTK.Platform.Windows
{ {
if (calledManually) if (calledManually)
{ {
if (Cursor != MouseCursor.Default && curson_handle != IntPtr.Zero)
{
Functions.DestroyIcon(curson_handle);
curson_handle = IntPtr.Zero;
}
// Safe to clean managed resources // Safe to clean managed resources
DestroyWindow(); DestroyWindow();
if (Icon != null) if (Icon != null)