diff --git a/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs b/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs index 023f2189..62e3c0ce 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs @@ -1057,6 +1057,12 @@ namespace OpenTK.Platform.SDL2 { DestroyWindow(); } + + if (sdl_cursor != IntPtr.Zero) + { + SDL.FreeCursor(sdl_cursor); + sdl_cursor = IntPtr.Zero; + } } else { diff --git a/Source/OpenTK/Platform/Windows/WinGLNative.cs b/Source/OpenTK/Platform/Windows/WinGLNative.cs index 36b91faf..19159540 100644 --- a/Source/OpenTK/Platform/Windows/WinGLNative.cs +++ b/Source/OpenTK/Platform/Windows/WinGLNative.cs @@ -1639,6 +1639,12 @@ namespace OpenTK.Platform.Windows { if (calledManually) { + if (Cursor != MouseCursor.Default && curson_handle != IntPtr.Zero) + { + Functions.DestroyIcon(curson_handle); + curson_handle = IntPtr.Zero; + } + // Safe to clean managed resources DestroyWindow(); if (Icon != null)