mirror of
https://github.com/troglobit/libuev.git
synced 2026-11-03 12:38:25 +00: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:
1 parent
2abeb39fe8
commit
3adc7a03c0
1 file changed
+3
-3
@@ -154,12 +154,12 @@ int uev_timer_start(uev_t *w)
|
|||||||
*/
|
*/
|
||||||
int uev_timer_stop(uev_t *w)
|
int uev_timer_stop(uev_t *w)
|
||||||
{
|
{
|
||||||
if (uev_watcher_stop(w))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
/* Stop kernel timer */
|
/* Stop kernel timer */
|
||||||
uev_timer_set(w, 0, 0);
|
uev_timer_set(w, 0, 0);
|
||||||
|
|
||||||
|
if (uev_watcher_stop(w))
|
||||||
|
return -1;
|
||||||
|
|
||||||
/* Close timerfd, will have to be reopened again on reset */
|
/* Close timerfd, will have to be reopened again on reset */
|
||||||
close(w->fd);
|
close(w->fd);
|
||||||
w->fd = -1;
|
w->fd = -1;
|
||||||
|
|||||||
Reference in new issue
Block a user