mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-07-01 15:25:35 +00:00
Fix busy looping forever after an evdev device goes away
This commit is contained in:
parent
74714e6fb1
commit
19442743a6
@ -170,6 +170,10 @@ static void evdev_remove(int devindex) {
|
|||||||
pthread_join(devices[devindex].meThread, NULL);
|
pthread_join(devices[devindex].meThread, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
libevdev_free(devices[devindex].dev);
|
||||||
|
loop_remove_fd(devices[devindex].fd);
|
||||||
|
close(devices[devindex].fd);
|
||||||
|
|
||||||
if (devindex != numDevices && numDevices > 0)
|
if (devindex != numDevices && numDevices > 0)
|
||||||
memcpy(&devices[devindex], &devices[numDevices], sizeof(struct input_device));
|
memcpy(&devices[devindex], &devices[numDevices], sizeof(struct input_device));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user