mirror of
https://github.com/swaywm/sway.git
synced 2024-11-22 16:01:27 +00:00
Event loop: Free fds and fix race condition
This commit is contained in:
parent
6921fdc6d6
commit
893f61d03a
|
@ -48,6 +48,7 @@ void loop_destroy(struct loop *loop) {
|
||||||
list_foreach(loop->timers, free);
|
list_foreach(loop->timers, free);
|
||||||
list_free(loop->fd_events);
|
list_free(loop->fd_events);
|
||||||
list_free(loop->timers);
|
list_free(loop->timers);
|
||||||
|
free(loop->fds);
|
||||||
free(loop);
|
free(loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +67,9 @@ void loop_poll(struct loop *loop) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ms < 0) {
|
||||||
|
ms = 0;
|
||||||
|
}
|
||||||
|
|
||||||
poll(loop->fds, loop->fd_length, ms);
|
poll(loop->fds, loop->fd_length, ms);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue