aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/input.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-11-02 16:37:31 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-11-02 16:47:50 -0300
commit75a5674cd2d0921400d2d2c7a9ce9701c58c5b25 (patch)
tree0d92e2b6dfc6bc721ffbd4afcde29081b3eef156 /src/nvim/os/input.c
parenta1dd70b1d0e9ef155c81eeb249f137e763482d10 (diff)
downloadrneovim-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/input.c')
-rw-r--r--src/nvim/os/input.c9
1 files changed, 9 insertions, 0 deletions
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)
{