From a7e425497b980de9dae0a9dc82d8885779d7dc7d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 7 Aug 2024 06:48:10 -0700 Subject: [PATCH] Added a FIXME to lock the joystick list and update the GameInput joystick support --- src/joystick/gdk/SDL_gameinputjoystick.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/joystick/gdk/SDL_gameinputjoystick.c b/src/joystick/gdk/SDL_gameinputjoystick.c index 7cceec9d0..5ab44c4a4 100644 --- a/src/joystick/gdk/SDL_gameinputjoystick.c +++ b/src/joystick/gdk/SDL_gameinputjoystick.c @@ -56,7 +56,7 @@ typedef struct joystick_hwdata GameInputCallbackToken guide_button_callback_token; } GAMEINPUT_InternalJoystickHwdata; - +// FIXME: We need a lock to protect the device list static GAMEINPUT_InternalList g_GameInputList = { NULL }; static void *g_hGameInputDLL = NULL; static IGameInput *g_pGameInput = NULL; @@ -103,6 +103,7 @@ static int GAMEINPUT_InternalAddOrFind(IGameInputDevice *pDevice) elem = g_GameInputList.devices[idx]; if (elem && elem->device == pDevice) { /* we're already added */ + elem->isDeleteRequested = SDL_FALSE; return 0; } }