Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
platforms/evdev: Clean up mir::Device handle on device remove (#3150)
Not all `ConsoleProvider`s will send a `removed` event on the `DeviceObserver` (in fact, only logind will), so we can't rely on that to clean up the handle in `device_watchers`. Furthermore, libinput itself will notice a device going away (by monitoring the fd) and generate `LIBINPUT_EVENT_DEVICE_REMOVED`, which we might process *before* the udev `REMOVED` event, and in *that* case, `device_removed` will have already deleted the `LibInputDevice` and so the udev event handler will *also* not clean up `device_watchers`. Resolve this by cleaning up `device_watchers` *only* in `device_removed`, and rely on the `DeviceObserver::removed` codepath triggering a libinput removal event. Fixes: #3149
- Loading branch information