aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-12-31 23:42:22 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2015-12-31 23:42:43 +0100
commit8564297e2a95254989e52470ecb8bbf556f1e4c9 (patch)
tree119bd7b864b9bd9699842a8cd8343f9060288a15
parentc015835d3a7f4d8b0343895891849ac94d24a1d1 (diff)
downloadxK-8564297e2a95254989e52470ecb8bbf556f1e4c9.tar.gz
xK-8564297e2a95254989e52470ecb8bbf556f1e4c9.tar.xz
xK-8564297e2a95254989e52470ecb8bbf556f1e4c9.zip
degesch: fix segfault on /quit under libedit
-rw-r--r--degesch.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/degesch.c b/degesch.c
index b7adad7..4831a3b 100644
--- a/degesch.c
+++ b/degesch.c
@@ -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);