Bug 1787 - memory leak in WIN_InitMouse() by Marcel Bakker
authorGabriel Jacobo <gabomdq@gmail.com>
Wed, 24 Apr 2013 12:22:08 -0300
changeset 7103 9d146930d4f2
parent 7102 b9fa5a2acbfd
child 7104 4e4ca313000c
Bug 1787 - memory leak in WIN_InitMouse() by Marcel Bakker
src/video/windows/SDL_windowsmouse.c
--- a/src/video/windows/SDL_windowsmouse.c	Wed Apr 24 11:49:52 2013 -0300
+++ b/src/video/windows/SDL_windowsmouse.c	Wed Apr 24 12:22:08 2013 -0300
@@ -240,6 +240,12 @@
 void
 WIN_QuitMouse(_THIS)
 {
+    SDL_Mouse *mouse = SDL_GetMouse();
+    if ( mouse->def_cursor ) {
+        SDL_free(mouse->def_cursor);
+        mouse->def_cursor = NULL;
+        mouse->cur_cursor = NULL;
+    }
 }
 
 #endif /* SDL_VIDEO_DRIVER_WINDOWS */