Fixed memory leak in Cocoa mouse code
authorSam Lantinga <slouken@libsdl.org>
Thu, 12 Oct 2017 13:28:48 -0700
changeset 11607db7ee6a1ba6a
parent 11606 a54e7ade4382
child 11610 6dea196ecbcb
Fixed memory leak in Cocoa mouse code
The video quit call cleans up the mouse cursor driver data, which happens after mouse quit
src/events/SDL_mouse.c
     1.1 --- a/src/events/SDL_mouse.c	Thu Oct 12 08:47:02 2017 -0700
     1.2 +++ b/src/events/SDL_mouse.c	Thu Oct 12 13:28:48 2017 -0700
     1.3 @@ -81,6 +81,8 @@
     1.4  {
     1.5      SDL_Mouse *mouse = SDL_GetMouse();
     1.6  
     1.7 +    SDL_zerop(mouse);
     1.8 +
     1.9      SDL_AddHintCallback(SDL_HINT_MOUSE_NORMAL_SPEED_SCALE,
    1.10                          SDL_MouseNormalSpeedScaleChanged, mouse);
    1.11  
    1.12 @@ -587,8 +589,6 @@
    1.13          SDL_free(mouse->clickstate);
    1.14      }
    1.15  
    1.16 -    SDL_zerop(mouse);
    1.17 -
    1.18      SDL_DelHintCallback(SDL_HINT_MOUSE_NORMAL_SPEED_SCALE,
    1.19                          SDL_MouseNormalSpeedScaleChanged, mouse);
    1.20