aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r--src/nvim/main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index b5207f9cf6..b0da7f4500 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -627,11 +627,13 @@ void os_exit(int r)
{
exiting = true;
- if (!ui_client_channel_id) {
+ if (ui_client_channel_id) {
+ ui_client_stop();
+ } else {
ui_flush();
+ ui_call_stop();
+ ml_close_all(true); // remove all memfiles
}
- ui_call_stop();
- ml_close_all(true); // remove all memfiles
if (!event_teardown() && r == 0) {
r = 1; // Exit with error if main_loop did not teardown gracefully.