mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 20:00:23 +02:00
re-write SIGTERM handling
Exit safely on SIGTERM by emitting "gui exit" from the main loops of fe-text and fe-none rather than from the signal handler itself. Based on feedback from Nei and dwfreed.
This commit is contained in:
parent
722d3c4c3d
commit
a237321b33
6 changed files with 32 additions and 19 deletions
|
|
@ -331,6 +331,11 @@ int main(int argc, char **argv)
|
|||
/* Does the same as g_main_run(main_loop), except we
|
||||
can call our dirty-checker after each iteration */
|
||||
while (!quitting) {
|
||||
if (sigterm_received) {
|
||||
sigterm_received = FALSE;
|
||||
signal_emit("gui exit", 0);
|
||||
}
|
||||
|
||||
if (sighup_received) {
|
||||
sighup_received = FALSE;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue