mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 17:36:29 +00:00
event: Ensure the event loop has been cleaned up in event_teardown
- Add input_teardown/signal_teardown to take care of closing signal/stdin handles. - Call those functions in event_teardown, and ensure there are no active handles by entering an infinite loop when there are unclosed handles(think of this as an assertion that can't go unoticed on travis). - Move event_teardown call to the end of mch_exit. That is required because event_poll may still be called in that function.
This commit is contained in:
@@ -55,6 +55,20 @@ void signal_init(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void signal_teardown(void)
|
||||
{
|
||||
signal_stop();
|
||||
uv_close((uv_handle_t *)&sint, NULL);
|
||||
uv_close((uv_handle_t *)&spipe, NULL);
|
||||
uv_close((uv_handle_t *)&shup, NULL);
|
||||
uv_close((uv_handle_t *)&squit, NULL);
|
||||
uv_close((uv_handle_t *)&sterm, NULL);
|
||||
uv_close((uv_handle_t *)&swinch, NULL);
|
||||
#ifdef SIGPWR
|
||||
uv_close((uv_handle_t *)&spwr, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void signal_stop(void)
|
||||
{
|
||||
uv_signal_stop(&sint);
|
||||
|
Reference in New Issue
Block a user