mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-14 13:56:00 +00:00
Fixed a crash when unplugging a Steam Controller dongle
This commit is contained in:
@@ -1250,7 +1250,9 @@ static void ControllerDisconnected(SDL_HIDAPI_Device *device, SDL_Joystick **joy
|
|||||||
{
|
{
|
||||||
SDL_DriverSteam_Context *ctx = (SDL_DriverSteam_Context *)device->context;
|
SDL_DriverSteam_Context *ctx = (SDL_DriverSteam_Context *)device->context;
|
||||||
|
|
||||||
HIDAPI_JoystickDisconnected(device, device->joysticks[0]);
|
if (device->joysticks) {
|
||||||
|
HIDAPI_JoystickDisconnected(device, device->joysticks[0]);
|
||||||
|
}
|
||||||
ctx->connected = false;
|
ctx->connected = false;
|
||||||
*joystick = NULL;
|
*joystick = NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user