mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-02 16:08:30 +00:00
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:
@@ -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);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user