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.
This commit is contained in:
zeertzjq 2024-10-21 07:22:42 +08:00 committed by GitHub
parent 0083e03d6f
commit 8c2d45be77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)
}