mirror of
https://github.com/yawut/SDL.git
synced 2026-08-27 03:07:10 -05:00
Fixed cursor leak when quitting the mouse subsystem
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -2247,8 +2247,6 @@ SDL_VideoQuit(void)
|
||||
|
||||
SDL_EnableScreenSaver();
|
||||
|
||||
SDL_ShowCursor(1);
|
||||
|
||||
/* Clean up the system video */
|
||||
while (_this->windows) {
|
||||
SDL_DestroyWindow(_this->windows);
|
||||
|
||||
Reference in New Issue
Block a user