From 2edae0d9d6892ac92554210aaa7f69573c9e3815 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 13 Jan 2019 17:14:08 +0000 Subject: [PATCH] GTK: unregister dialog boxes before delivering the result. When the user clicks 'yes' to a 'weak crypto primitive' warning, and another such warning is pending next in line, we were failing an assertion when ssh2transport called register_dialog() for the second warning box, because the result callback in gtkdlg.c had not called unregister_dialog() for the previous one yet. Now that's done before rather than after delivering the result to the dialog's client. --- unix/gtkdlg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unix/gtkdlg.c b/unix/gtkdlg.c index d28accde..1d00a22e 100644 --- a/unix/gtkdlg.c +++ b/unix/gtkdlg.c @@ -3540,6 +3540,8 @@ static void simple_prompt_result_callback(void *vctx, int result) struct simple_prompt_result_ctx *ctx = (struct simple_prompt_result_ctx *)vctx; + unregister_dialog(ctx->seat, ctx->dialog_slot); + if (result >= 0) ctx->callback(ctx->callback_ctx, result); @@ -3547,7 +3549,6 @@ static void simple_prompt_result_callback(void *vctx, int result) * Clean up this context structure, whether or not a result was * ever actually delivered from the dialog box. */ - unregister_dialog(ctx->seat, ctx->dialog_slot); sfree(ctx); }