commit 8c2d45be77299d6eb70165697bc5c29898cdb25e
parent 0083e03d6fa7586d0d6360b40b52b0cab0d2e7ba
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon, 21 Oct 2024 07:22:42 +0800
fix(exit): close memfiles after processing events (#30872)
Problem: When exiting, processed events may still use memfiles after
they are closed.
Solution: Close memfiles after processing events.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/nvim/main.c b/src/nvim/main.c
@@ -678,12 +678,14 @@ void os_exit(int r)
} else {
ui_flush();
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.
}
+ if (!ui_client_channel_id) {
+ ml_close_all(true); // remove all memfiles
+ }
if (used_stdin) {
stream_set_blocking(STDIN_FILENO, true); // normalize stream (#2598)
}