mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-10 16:10:21 +01:00
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:
parent
ff6633db97
commit
5e24b35ecb
1 changed files with 2 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue