Make context reference counted
authorJonas Ådahl <jadahl@gmail.com>
Tue, 24 Jun 2014 22:06:58 +0000 (00:06 +0200)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 25 Jun 2014 00:27:03 +0000 (10:27 +1000)
commitfaab25c25cd9cf1b76962e9cb8b26c2c754c0cde
tree5cbafa0b852e86d726bddd482b08a612ef99174e
parent13e9a1d7449d3b5db1dc7d9cf3aa6187911ee08c
Make context reference counted

Instead of only allowing one owner keeping a libinput context alive,
make context reference counted, replacing libinput_destroy() with
libinput_unref() while adding another function libinput_ref().

Even though there might not be any current use cases, it doesn't mean we
should hard code this usage model in the API. The old behaviour can be
emulated by never calling libinput_ref() while replacing
libinput_destroy() with libinput_unref().

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
13 files changed:
src/libinput-private.h
src/libinput.c
src/libinput.h
src/udev-seat.c
test/keyboard.c
test/litest.c
test/log.c
test/misc.c
test/path.c
test/pointer.c
test/udev.c
tools/event-debug.c
tools/event-gui.c