Skip to content

Commit

Permalink
Fixed memory leak in Cocoa mouse code
Browse files Browse the repository at this point in the history
The video quit call cleans up the mouse cursor driver data, which happens after mouse quit
  • Loading branch information
slouken committed Oct 12, 2017
1 parent f4cd68a commit 1887c54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/events/SDL_mouse.c
Expand Up @@ -81,6 +81,8 @@ SDL_MouseInit(void)
{
SDL_Mouse *mouse = SDL_GetMouse();

SDL_zerop(mouse);

SDL_AddHintCallback(SDL_HINT_MOUSE_NORMAL_SPEED_SCALE,
SDL_MouseNormalSpeedScaleChanged, mouse);

Expand Down Expand Up @@ -587,8 +589,6 @@ SDL_MouseQuit(void)
SDL_free(mouse->clickstate);
}

SDL_zerop(mouse);

SDL_DelHintCallback(SDL_HINT_MOUSE_NORMAL_SPEED_SCALE,
SDL_MouseNormalSpeedScaleChanged, mouse);

Expand Down

0 comments on commit 1887c54

Please sign in to comment.