Added a FIXME to lock the joystick list and update the GameInput joystick support

This commit is contained in:
Sam Lantinga 2024-08-07 06:48:10 -07:00
parent 001dbc5da8
commit a7e425497b
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}
}