mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-19 20:46:05 +00:00
Fixed potential infinite recursion opening a Steam Controller
This can happen if the controller is opened from an event watcher when the controller is connected.
This commit is contained in:
parent
d62f141b29
commit
dccf486a0a
1 changed files with 2 additions and 1 deletions
|
|
@ -245,6 +245,8 @@ static bool HIDAPI_DriverSteamTriton_SetControllerConnected(SDL_HIDAPI_Device *d
|
|||
SDL_DriverSteamTriton_Context *ctx = (SDL_DriverSteamTriton_Context *)device->context;
|
||||
|
||||
if (ctx->connected != connected) {
|
||||
ctx->connected = connected;
|
||||
|
||||
if (connected) {
|
||||
SDL_JoystickID joystickID;
|
||||
if (!HIDAPI_JoystickConnected(device, &joystickID)) {
|
||||
|
|
@ -255,7 +257,6 @@ static bool HIDAPI_DriverSteamTriton_SetControllerConnected(SDL_HIDAPI_Device *d
|
|||
HIDAPI_JoystickDisconnected(device, device->joysticks[0]);
|
||||
}
|
||||
}
|
||||
ctx->connected = connected;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue