tools: use a cleanup func for the event in the demo client

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-10-21 10:23:59 +10:00
parent ff6633db97
commit 5e24b35ecb

View file

@ -47,6 +47,7 @@
DEFINE_TRIVIAL_CLEANUP_FUNC(struct ei *, ei_unref);
DEFINE_TRIVIAL_CLEANUP_FUNC(struct ei_device *, ei_device_unref);
DEFINE_TRIVIAL_CLEANUP_FUNC(struct ei_keymap *, ei_keymap_unref);
DEFINE_TRIVIAL_CLEANUP_FUNC(struct ei_event *, ei_event_unref);
static inline void
_printf_(1, 2)
@ -259,7 +260,7 @@ int main(int argc, char **argv)
ei_dispatch(ei);
while (!stop) {
struct ei_event *e = ei_get_event(ei);
_cleanup_(ei_event_unrefp) struct ei_event *e = ei_get_event(ei);
if (!e)
break;
@ -323,7 +324,6 @@ int main(int argc, char **argv)
default:
abort();
}
ei_event_unref(e);
}
if (have_ptr) {