/quit now exits from the event loop

Before this change issuing `/quit` directly called `exit(0)` and did not
invoke all the graceful shutdown routines. Now we first try to exit from
the event loop, which includes cleaning up everything.
In case the event loop is stuck for some reason, you could try to issue a
second `/quit`, which will then directly call `exit(0)`.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
Steffen Jaeckel
2025-01-06 12:35:06 +01:00
parent 2696989ce5
commit 8151dfa3b4
3 changed files with 6 additions and 3 deletions

View File

@@ -1328,7 +1328,8 @@ gboolean
cmd_quit(ProfWin* window, const char* const command, gchar** args)
{
log_info("Profanity is shutting down…");
exit(0);
if (prof_set_quit())
exit(0);
return FALSE;
}