From 75a5674cd2d0921400d2d2c7a9ce9701c58c5b25 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Sun, 2 Nov 2014 16:37:31 -0300 Subject: 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. --- src/nvim/os/input.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/nvim/os/input.c') diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index d948a48b64..3ebfb3f12b 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -52,6 +52,15 @@ void input_init(void) rstream_set_file(read_stream, read_cmd_fd); } +void input_teardown(void) +{ + if (embedded_mode) { + return; + } + + rstream_free(read_stream); +} + // Listen for input void input_start(void) { -- cgit