diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-02 16:37:31 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-02 16:47:50 -0300 |
commit | 75a5674cd2d0921400d2d2c7a9ce9701c58c5b25 (patch) | |
tree | 0d92e2b6dfc6bc721ffbd4afcde29081b3eef156 /src/nvim/os/event.c | |
parent | a1dd70b1d0e9ef155c81eeb249f137e763482d10 (diff) | |
download | rneovim-75a5674cd2d0921400d2d2c7a9ce9701c58c5b25.tar.gz rneovim-75a5674cd2d0921400d2d2c7a9ce9701c58c5b25.tar.bz2 rneovim-75a5674cd2d0921400d2d2c7a9ce9701c58c5b25.zip |
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.
Diffstat (limited to 'src/nvim/os/event.c')
-rw-r--r-- | src/nvim/os/event.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/os/event.c b/src/nvim/os/event.c index e09303e505..ecaec0b9ce 100644 --- a/src/nvim/os/event.c +++ b/src/nvim/os/event.c @@ -71,7 +71,15 @@ void event_teardown(void) channel_teardown(); job_teardown(); server_teardown(); + signal_teardown(); input_stop(); + input_teardown(); + do { + // This will loop forever if we leave any unclosed handles. Currently it is + // the most reliable way to use travis for verifying the no libuv-related + // bugs(which can be hard to track later) were introduced on a PR. + uv_run(uv_default_loop(), UV_RUN_DEFAULT); + } while (uv_loop_close(uv_default_loop())); } // Wait for some event |