device = evdev_device_create(&seat->base, devnode, fd);
if (device == EVDEV_UNHANDLED_DEVICE) {
- close(fd);
+ weston_launcher_close(c->launcher, fd);
weston_log("not using input device '%s'.\n", devnode);
return 0;
} else if (device == NULL) {
- close(fd);
+ weston_launcher_close(c->launcher, fd);
weston_log("failed to create input device '%s'.\n", devnode);
return 0;
}
if (!strcmp(device->devnode, devnode)) {
weston_log("input device %s, %s removed\n",
device->devname, device->devnode);
+ weston_launcher_close(input->compositor->launcher,
+ device->fd);
evdev_device_destroy(device);
- break;
- }
+ break;
+ }
}
}
struct udev_seat *seat;
wl_list_for_each(seat, &input->compositor->seat_list, base.link) {
- wl_list_for_each_safe(device, next, &seat->devices_list, link)
+ wl_list_for_each_safe(device, next, &seat->devices_list, link) {
+ weston_launcher_close(input->compositor->launcher,
+ device->fd);
evdev_device_destroy(device);
+ }
if (seat->base.keyboard)
notify_keyboard_focus_out(&seat->base);