mirror of
https://github.com/troglobit/libuev.git
synced 2026-10-02 05:42:36 +07:00
Fix issue #6: Segfault when stopping timer before calling uev_exit()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user