From 27af3999922307eaa5ede00645e1b3707cf7cb31 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 1 Aug 2022 14:51:54 +1000 Subject: [PATCH] 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. --- tools/ei-demo-client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ei-demo-client.c b/tools/ei-demo-client.c index 2600d56..df704de 100644 --- a/tools/ei-demo-client.c +++ b/tools/ei-demo-client.c @@ -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); } }