diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-12-31 23:42:22 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-12-31 23:42:43 +0100 |
commit | 8564297e2a95254989e52470ecb8bbf556f1e4c9 (patch) | |
tree | 119bd7b864b9bd9699842a8cd8343f9060288a15 /degesch.c | |
parent | c015835d3a7f4d8b0343895891849ac94d24a1d1 (diff) | |
download | xK-8564297e2a95254989e52470ecb8bbf556f1e4c9.tar.gz xK-8564297e2a95254989e52470ecb8bbf556f1e4c9.tar.xz xK-8564297e2a95254989e52470ecb8bbf556f1e4c9.zip |
degesch: fix segfault on /quit under libedit
Diffstat (limited to 'degesch.c')
-rw-r--r-- | degesch.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -3989,8 +3989,8 @@ initiate_quit (struct app_context *ctx) { log_global_status (ctx, "Shutting down"); - // Destroy the user interface - input_stop (&ctx->input); + // Hide the user interface + input_hide (&ctx->input); // Initiate a connection close struct str_map_iter iter; @@ -11569,9 +11569,7 @@ on_tty_readable (const struct pollfd *fd, struct app_context *ctx) process_mirc_escape (fd, ctx); else if (ctx->in_bracketed_paste) process_bracketed_paste (fd, ctx); - else if (ctx->input.active) - // XXX: this may loop for a bit: stop the event or eat the input? - // (This prevents a segfault when the input has been stopped.) + else if (!ctx->quitting) input_on_readable (&ctx->input); // User activity detected, stop current auto-away and start anew; @@ -11866,6 +11864,8 @@ main (int argc, char *argv[]) while (ctx.polling) poller_run (&ctx.poller); + input_stop (&ctx.input); + if (get_config_boolean (ctx.config.root, "behaviour.save_on_quit")) save_configuration (&ctx); |