mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-22 21:05:12 +00:00
SDL_udev: check for NULL return value from udev_device_get_action
Signed-off-by: Steven Noonan <steven@valvesoftware.com> Signed-off-by: Sam Lantinga <slouken@libsdl.org>
This commit is contained in:
parent
cf05a5eb0c
commit
b15bbd4e3f
|
@ -449,6 +449,7 @@ SDL_UDEV_Poll(void)
|
|||
}
|
||||
action = _this->syms.udev_device_get_action(dev);
|
||||
|
||||
if (action) {
|
||||
if (SDL_strcmp(action, "add") == 0) {
|
||||
/* Wait for the device to finish initialization */
|
||||
SDL_Delay(100);
|
||||
|
@ -457,6 +458,7 @@ SDL_UDEV_Poll(void)
|
|||
} else if (SDL_strcmp(action, "remove") == 0) {
|
||||
device_event(SDL_UDEV_DEVICEREMOVED, dev);
|
||||
}
|
||||
}
|
||||
|
||||
_this->syms.udev_device_unref(dev);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue