mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2026-04-03 23:10:39 +02:00
Free the event queue on cleanup.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
8bdd0639a6
commit
0867f2f10a
2 changed files with 9 additions and 0 deletions
|
|
@ -168,6 +168,14 @@ queue_alloc(struct libevdev *dev, int size)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
queue_free(struct libevdev *dev)
|
||||
{
|
||||
free(dev->queue);
|
||||
dev->queue_size = 0;
|
||||
dev->queue_next = 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
queue_num_elements(struct libevdev *dev)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ libevdev_new(int fd)
|
|||
void
|
||||
libevdev_free(struct libevdev *dev)
|
||||
{
|
||||
queue_free(dev);
|
||||
free(dev);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue