# HG changeset patch # User Sam Lantinga # Date 1374434482 25200 # Node ID 7bfda8f0bfdf4f40f2bb8b1582c6ec254db3cc66 # Parent 98de3e4f1c36b1c19d7b7375c4fc78d19c763789 Fixed cursor leak when quitting the mouse subsystem diff -r 98de3e4f1c36 -r 7bfda8f0bfdf src/events/SDL_mouse.c --- a/src/events/SDL_mouse.c Sun Jul 21 11:52:16 2013 -0700 +++ b/src/events/SDL_mouse.c Sun Jul 21 12:21:22 2013 -0700 @@ -361,6 +361,23 @@ void SDL_MouseQuit(void) { + SDL_Cursor *cursor, *next; + SDL_Mouse *mouse = SDL_GetMouse(); + + SDL_ShowCursor(1); + + cursor = mouse->cursors; + while (cursor) { + next = cursor->next; + SDL_FreeCursor(cursor); + cursor = next; + } + + if (mouse->def_cursor && mouse->FreeCursor) { + mouse->FreeCursor(mouse->def_cursor); + } + + SDL_zerop(mouse); } Uint32 diff -r 98de3e4f1c36 -r 7bfda8f0bfdf src/video/SDL_video.c --- a/src/video/SDL_video.c Sun Jul 21 11:52:16 2013 -0700 +++ b/src/video/SDL_video.c Sun Jul 21 12:21:22 2013 -0700 @@ -2247,8 +2247,6 @@ SDL_EnableScreenSaver(); - SDL_ShowCursor(1); - /* Clean up the system video */ while (_this->windows) { SDL_DestroyWindow(_this->windows);