mirror of https://github.com/encounter/SDL.git
Fixed memory leak in Cocoa mouse code
The video quit call cleans up the mouse cursor driver data, which happens after mouse quit
This commit is contained in:
parent
f4cd68a537
commit
1887c54c68
|
@ -81,6 +81,8 @@ SDL_MouseInit(void)
|
||||||
{
|
{
|
||||||
SDL_Mouse *mouse = SDL_GetMouse();
|
SDL_Mouse *mouse = SDL_GetMouse();
|
||||||
|
|
||||||
|
SDL_zerop(mouse);
|
||||||
|
|
||||||
SDL_AddHintCallback(SDL_HINT_MOUSE_NORMAL_SPEED_SCALE,
|
SDL_AddHintCallback(SDL_HINT_MOUSE_NORMAL_SPEED_SCALE,
|
||||||
SDL_MouseNormalSpeedScaleChanged, mouse);
|
SDL_MouseNormalSpeedScaleChanged, mouse);
|
||||||
|
|
||||||
|
@ -587,8 +589,6 @@ SDL_MouseQuit(void)
|
||||||
SDL_free(mouse->clickstate);
|
SDL_free(mouse->clickstate);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_zerop(mouse);
|
|
||||||
|
|
||||||
SDL_DelHintCallback(SDL_HINT_MOUSE_NORMAL_SPEED_SCALE,
|
SDL_DelHintCallback(SDL_HINT_MOUSE_NORMAL_SPEED_SCALE,
|
||||||
SDL_MouseNormalSpeedScaleChanged, mouse);
|
SDL_MouseNormalSpeedScaleChanged, mouse);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue