1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-13 09:08:06 -05:00

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.
This commit is contained in:
Simon Tatham 2019-01-13 17:14:08 +00:00
parent 637814544c
commit 2edae0d9d6

View File

@ -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);
}