degesch: readline cleanup

This commit is contained in:
Přemysl Eric Janouch 2015-04-18 16:10:11 +02:00
parent 932548ef4b
commit e65b38bff9
1 changed files with 5 additions and 7 deletions

View File

@ -1060,6 +1060,9 @@ initiate_quit (struct app_context *ctx)
ctx->readline_prompt_shown = false;
}
// This is okay as long as we're not called from within readline
rl_callback_handler_remove ();
// Initiate a connection close
buffer_send_status (ctx, ctx->global_buffer, "shutting down");
if (ctx->irc_fd != -1)
@ -2290,10 +2293,8 @@ on_readline_input (char *line)
rl_ding ();
}
if (g_ctx->quitting)
rl_callback_handler_remove ();
else
// initiate_quit() disables readline; we just wait then
// initiate_quit() disables readline; we just wait then
if (!g_ctx->quitting)
g_ctx->readline_prompt_shown = true;
}
@ -2626,9 +2627,6 @@ main (int argc, char *argv[])
while (ctx.polling)
poller_run (&ctx.poller);
if (ctx.readline_prompt_shown)
rl_callback_handler_remove ();
app_context_free (&ctx);
free_terminal ();
return EXIT_SUCCESS;