Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed cursor leak when quitting the mouse subsystem

  • Loading branch information
slouken committed Jul 21, 2013
1 parent ac155cf commit 8d909ffbcac6be24b882b34c44f54d00d23b4bb6
Showing with 17 additions and 2 deletions.
  1. +17 −0 src/events/SDL_mouse.c
  2. +0 −2 src/video/SDL_video.c
@@ -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);

0 comments on commit 8d909ff

Please sign in to comment.