projects
/
platform
/
upstream
/
libinput.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0ac1ef
)
Add two asserts to avoid underrunning the seat/device refcount
author
Peter Hutterer
<peter.hutterer@who-t.net>
Wed, 8 Jan 2014 06:40:14 +0000
(16:40 +1000)
committer
Jonas Ådahl
<jadahl@gmail.com>
Wed, 8 Jan 2014 19:45:58 +0000
(20:45 +0100)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/libinput.c
patch
|
blob
|
history
diff --git
a/src/libinput.c
b/src/libinput.c
index
06b7263
..
550ca94
100644
(file)
--- a/
src/libinput.c
+++ b/
src/libinput.c
@@
-504,6
+504,7
@@
libinput_seat_destroy(struct libinput_seat *seat)
LIBINPUT_EXPORT void
libinput_seat_unref(struct libinput_seat *seat)
{
+ assert(seat->refcount > 0);
seat->refcount--;
if (seat->refcount == 0)
libinput_seat_destroy(seat);
@@
-550,6
+551,7
@@
libinput_device_destroy(struct libinput_device *device)
LIBINPUT_EXPORT void
libinput_device_unref(struct libinput_device *device)
{
+ assert(device->refcount > 0);
device->refcount--;
if (device->refcount == 0)
libinput_device_destroy(device);