uloop: clear processes and timeouts on uloop_done()
This commit is contained in:
parent
0001d8ab26
commit
cca2ed6c8c
1 changed files with 19 additions and 0 deletions
19
uloop.c
19
uloop.c
|
@ -455,6 +455,22 @@ static void uloop_process_timeouts(struct timeval *tv)
|
|||
}
|
||||
}
|
||||
|
||||
static void uloop_clear_timeouts(void)
|
||||
{
|
||||
struct uloop_timeout *t, *tmp;
|
||||
|
||||
list_for_each_entry_safe(t, tmp, &timeouts, list)
|
||||
uloop_timeout_cancel(t);
|
||||
}
|
||||
|
||||
static void uloop_clear_processes(void)
|
||||
{
|
||||
struct uloop_process *p, *tmp;
|
||||
|
||||
list_for_each_entry_safe(p, tmp, &processes, list)
|
||||
uloop_process_delete(p);
|
||||
}
|
||||
|
||||
void uloop_run(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
@ -480,4 +496,7 @@ void uloop_done(void)
|
|||
|
||||
close(poll_fd);
|
||||
poll_fd = -1;
|
||||
|
||||
uloop_clear_timeouts();
|
||||
uloop_clear_processes();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue