mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-28 11:57:24 +08:00
Fixed crash unplugging a HIDAPI controller
This commit is contained in:
@@ -1135,12 +1135,13 @@ check_removed:
|
|||||||
goto check_removed;
|
goto check_removed;
|
||||||
} else {
|
} else {
|
||||||
HIDAPI_DelDevice(device);
|
HIDAPI_DelDevice(device);
|
||||||
|
device = NULL;
|
||||||
|
|
||||||
// Update the device list again in case this device comes back
|
// Update the device list again in case this device comes back
|
||||||
SDL_HIDAPI_change_count = 0;
|
SDL_HIDAPI_change_count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (device->broken && device->parent) {
|
if (device && device->broken && device->parent) {
|
||||||
HIDAPI_DelDevice(device->parent);
|
HIDAPI_DelDevice(device->parent);
|
||||||
|
|
||||||
// We deleted a different device here, restart the loop
|
// We deleted a different device here, restart the loop
|
||||||
|
|||||||
Reference in New Issue
Block a user