Fix issue #6: Segfault when stopping timer before calling uev_exit()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2015-08-30 18:02:47 +02:00
parent 2abeb39fe8
commit 3adc7a03c0
+3 -3
View File
@@ -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;