diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-03 15:53:58 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-03 21:51:51 -0300 |
commit | c9cc2aa53d3adcef813d56107058d4b261488f66 (patch) | |
tree | d93c9c039a2c8bc60a1ddf0e2a1973ccf972b91a | |
parent | 636fc6b08d05a55e24a7e7fc7df48d9563e085a2 (diff) | |
download | rneovim-c9cc2aa53d3adcef813d56107058d4b261488f66.tar.gz rneovim-c9cc2aa53d3adcef813d56107058d4b261488f66.tar.bz2 rneovim-c9cc2aa53d3adcef813d56107058d4b261488f66.zip |
event: Assert that all libuv handles are closed on exit.
Travis build will now fail when core files are dumped, so call `abort()` when
the event loop is not fully released before exiting.
-rw-r--r-- | src/nvim/os/event.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/nvim/os/event.c b/src/nvim/os/event.c index bfb8a625ef..5a5da5cd63 100644 --- a/src/nvim/os/event.c +++ b/src/nvim/os/event.c @@ -79,12 +79,14 @@ void event_teardown(void) 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())); + // this last `uv_run` will return after all handles are stopped, it will + // also take care of finishing any uv_close calls made by other *_teardown + // functions. + uv_run(uv_default_loop(), UV_RUN_DEFAULT); + // abort that if we left unclosed handles + if (uv_loop_close(uv_default_loop())) { + abort(); + } } // Wait for some event |