Recover from Bluetooth devices temporarily out of range

main
Sam Lantinga 2022-08-09 17:04:26 -07:00
parent 6d012b2a5d
commit 1db7d33dc4
1 changed files with 2 additions and 0 deletions

View File

@ -1111,6 +1111,8 @@ HIDAPI_JoystickOpen(SDL_Joystick *joystick, int device_index)
hwdata->device = device; hwdata->device = device;
if (!device->driver->OpenJoystick(device, joystick)) { if (!device->driver->OpenJoystick(device, joystick)) {
/* The open failed, mark this device as disconnected and update devices */
HIDAPI_JoystickDisconnected(device, joystickID);
SDL_free(hwdata); SDL_free(hwdata);
return -1; return -1;
} }