Fixed cursor leak when quitting the mouse subsystem

This commit is contained in:
Sam Lantinga 2013-07-21 12:21:22 -07:00
parent 958740dffc
commit 080517ecba
2 changed files with 17 additions and 2 deletions

View file

@ -361,6 +361,23 @@ SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y)
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