pen: fix leak caused by pen subsystem
This commit is contained in:
parent
fbb0914b78
commit
a197efe3a7
@ -898,6 +898,7 @@ void SDL_QuitMouse(void)
|
||||
}
|
||||
SDL_SetRelativeMouseMode(SDL_FALSE);
|
||||
SDL_ShowCursor();
|
||||
SDL_PenQuit();
|
||||
|
||||
if (mouse->def_cursor) {
|
||||
SDL_SetDefaultCursor(NULL);
|
||||
|
@ -829,6 +829,19 @@ void SDL_PenInit(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void SDL_PenQuit(void)
|
||||
{
|
||||
SDL_DelHintCallback(SDL_HINT_PEN_NOT_MOUSE,
|
||||
SDL_PenUpdateHint, &pen_mouse_emulation_mode);
|
||||
|
||||
SDL_DelHintCallback(SDL_HINT_PEN_DELAY_MOUSE_BUTTON,
|
||||
SDL_PenUpdateHint, &pen_delay_mouse_button_mode);
|
||||
#ifndef SDL_THREADS_DISABLED
|
||||
SDL_DestroyMutex(SDL_pen_access_lock);
|
||||
SDL_pen_access_lock = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_bool SDL_PenPerformHitTest(void)
|
||||
{
|
||||
return pen_mouse_emulation_mode == PEN_MOUSE_EMULATE;
|
||||
|
@ -331,6 +331,11 @@ extern int SDL_SendPenWindowEvent(Uint64 timestamp, SDL_PenID instance_id, SDL_W
|
||||
*/
|
||||
extern void SDL_PenInit(void);
|
||||
|
||||
/**
|
||||
* De-initialises the pen subsystem.
|
||||
*/
|
||||
extern void SDL_PenQuit(void);
|
||||
|
||||
#endif /* SDL_pen_c_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
@ -54,6 +54,7 @@
|
||||
#define SDL_SendPenWindowEvent SDL_SUT_SendPenWindowEvent
|
||||
#define SDL_PenPerformHitTest SDL_SUT_PenPerformHitTest
|
||||
#define SDL_PenInit SDL_SUT_PenInit
|
||||
#define SDL_PenQuit SDL_SUT_PenQuit
|
||||
|
||||
/* ================= Mock API ================== */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user