diff options
Diffstat (limited to 'swaybar/event_loop.c')
-rw-r--r-- | swaybar/event_loop.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/swaybar/event_loop.c b/swaybar/event_loop.c index 80655d8b..0d1be1da 100644 --- a/swaybar/event_loop.c +++ b/swaybar/event_loop.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _XOPEN_SOURCE 700 #include <stdlib.h> #include <stdbool.h> #include <string.h> @@ -96,7 +96,7 @@ bool remove_event(int fd) { static int timer_item_timer_cmp(const void *_timer_item, const void *_timer) { const struct timer_item *timer_item = _timer_item; const timer_t *timer = _timer; - if (timer_item->timer == timer) { + if (timer_item->timer == *timer) { return 0; } else { return -1; @@ -105,6 +105,7 @@ static int timer_item_timer_cmp(const void *_timer_item, const void *_timer) { bool remove_timer(timer_t timer) { int index = list_seq_find(event_loop.timers, timer_item_timer_cmp, &timer); if (index != -1) { + free(event_loop.timers->items[index]); list_del(event_loop.timers, index); return true; } |