diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-05-30 01:25:25 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-06-07 00:26:21 +0200 |
commit | 698ec9eb6e97ce9038e5f95a3208b7a0ac8da805 (patch) | |
tree | 0692e508d6a455adaa59b611fee8802b0033df7e /src/nvim/main.c | |
parent | f83d733318d27ed8ad9fc7a442142ee8a74b7a39 (diff) | |
download | rneovim-698ec9eb6e97ce9038e5f95a3208b7a0ac8da805.tar.gz rneovim-698ec9eb6e97ce9038e5f95a3208b7a0ac8da805.tar.bz2 rneovim-698ec9eb6e97ce9038e5f95a3208b7a0ac8da805.zip |
loop_close: Avoid infinite loop, and log it.
Avoids a hang, and also helps diagnose issues like:
https://github.com/neovim/neovim/pull/6594#issuecomment-298321826
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r-- | src/nvim/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index 46607da6ea..19a661d7db 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -153,10 +153,11 @@ void event_init(void) terminal_init(); } -void event_teardown(void) +/// @returns false if main_loop could not be closed gracefully +bool event_teardown(void) { if (!main_loop.events) { - return; + return true; } multiqueue_process_events(main_loop.events); @@ -168,7 +169,7 @@ void event_teardown(void) signal_teardown(); terminal_teardown(); - loop_close(&main_loop, true); + return loop_close(&main_loop, true); } /// Performs early initialization. |