mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-28 10:40:26 +01:00
tools/demo-client: keep a ref to the ptr/kbd/abs devices
Otherwise calling unref on them on exit makes the demo client go boom.
This commit is contained in:
parent
f6aaedf701
commit
27af399992
1 changed files with 3 additions and 3 deletions
|
|
@ -331,16 +331,16 @@ int main(int argc, char **argv)
|
|||
|
||||
if (ei_device_has_capability(device, EI_DEVICE_CAP_POINTER)) {
|
||||
colorprint("New pointer device: %s\n", ei_device_get_name(device));
|
||||
ptr = device;
|
||||
ptr = ei_device_ref(device);
|
||||
}
|
||||
if (ei_device_has_capability(device, EI_DEVICE_CAP_KEYBOARD)) {
|
||||
colorprint("New keyboard device: %s\n", ei_device_get_name(device));
|
||||
kbd = device;
|
||||
kbd = ei_device_ref(device);
|
||||
handle_keymap(e);
|
||||
}
|
||||
if (ei_device_has_capability(device, EI_DEVICE_CAP_POINTER_ABSOLUTE)) {
|
||||
colorprint("New abs pointer device: %s\n", ei_device_get_name(device));
|
||||
abs = device;
|
||||
abs = ei_device_ref(device);
|
||||
handle_regions(device);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue