degesch: fix segfault on /quit under libedit

This commit is contained in:
Přemysl Eric Janouch 2015-12-31 23:42:22 +01:00
parent c015835d3a
commit 8564297e2a
1 changed files with 5 additions and 5 deletions

View File

@ -3989,8 +3989,8 @@ initiate_quit (struct app_context *ctx)
{ {
log_global_status (ctx, "Shutting down"); log_global_status (ctx, "Shutting down");
// Destroy the user interface // Hide the user interface
input_stop (&ctx->input); input_hide (&ctx->input);
// Initiate a connection close // Initiate a connection close
struct str_map_iter iter; 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); process_mirc_escape (fd, ctx);
else if (ctx->in_bracketed_paste) else if (ctx->in_bracketed_paste)
process_bracketed_paste (fd, ctx); process_bracketed_paste (fd, ctx);
else if (ctx->input.active) else if (!ctx->quitting)
// XXX: this may loop for a bit: stop the event or eat the input?
// (This prevents a segfault when the input has been stopped.)
input_on_readable (&ctx->input); input_on_readable (&ctx->input);
// User activity detected, stop current auto-away and start anew; // User activity detected, stop current auto-away and start anew;
@ -11866,6 +11864,8 @@ main (int argc, char *argv[])
while (ctx.polling) while (ctx.polling)
poller_run (&ctx.poller); poller_run (&ctx.poller);
input_stop (&ctx.input);
if (get_config_boolean (ctx.config.root, "behaviour.save_on_quit")) if (get_config_boolean (ctx.config.root, "behaviour.save_on_quit"))
save_configuration (&ctx); save_configuration (&ctx);