Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed cursor leak when quitting the mouse subsystem
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jul 21, 2013
1 parent ac155cf commit 8d909ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 17 additions & 0 deletions src/events/SDL_mouse.c
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/video/SDL_video.c
Expand Up @@ -2247,8 +2247,6 @@ SDL_VideoQuit(void)

SDL_EnableScreenSaver();

SDL_ShowCursor(1);

/* Clean up the system video */
while (_this->windows) {
SDL_DestroyWindow(_this->windows);
Expand Down

0 comments on commit 8d909ff

Please sign in to comment.