From 3adc7a03c0727490195dfe0c8ef57794a7dfd640 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 30 Aug 2015 18:02:47 +0200 Subject: [PATCH] Fix issue #6: Segfault when stopping timer before calling uev_exit() Signed-off-by: Joachim Nilsson --- timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/timer.c b/timer.c index be05d76..7b307f7 100644 --- a/timer.c +++ b/timer.c @@ -154,12 +154,12 @@ int uev_timer_start(uev_t *w) */ int uev_timer_stop(uev_t *w) { - if (uev_watcher_stop(w)) - return -1; - /* Stop kernel timer */ uev_timer_set(w, 0, 0); + if (uev_watcher_stop(w)) + return -1; + /* Close timerfd, will have to be reopened again on reset */ close(w->fd); w->fd = -1;