printoperation-unix: Fix a use-after-free

It turns out that finish_print destroys the
PrintResponseData, so we can't access it afterwards.
This commit is contained in:
Matthias Clasen 2020-05-12 14:09:51 -04:00
parent 3b9a8194a5
commit 09ea880a43

View File

@ -650,6 +650,9 @@ handle_print_response (GtkWidget *dialog,
gtk_print_operation_set_print_settings (rdata->op, settings);
g_signal_emit_by_name (rdata->op, "custom-widget-apply", rdata->op->priv->custom_widget);
}
if (rdata->loop)
g_main_loop_quit (rdata->loop);
finish_print (rdata, printer, page_setup, settings, page_setup_set);
@ -657,9 +660,6 @@ handle_print_response (GtkWidget *dialog,
g_object_unref (settings);
gtk_window_destroy (GTK_WINDOW (pd));
if (rdata->loop)
g_main_loop_quit (rdata->loop);
}