commit 275d19822f35345f7b8f5e35b31fb75aae3220a2
parent 07ced7167db4bcf16b5da7ba8222584b4fd6f3b2
Author: Jonathan Boeing <jonathan@claws-mail.org>
Date: Wed, 1 Sep 2021 13:07:19 -0700
Fix crashes in Fancy when printing
Fix a crash due to a race between the background initialization of the newly
created WebKitWebView and launching the print dialog.
Also fix a crash due to an allocate/free mismatch with the WebKitPrintOperation
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/plugins/fancy/fancy_viewer.c b/src/plugins/fancy/fancy_viewer.c
@@ -306,7 +306,6 @@ static gboolean fancy_set_contents(FancyViewer *viewer, gboolean use_defaults)
NULL);
g_free(contents);
}
- viewer->loading = FALSE;
return FALSE;
}
@@ -387,7 +386,7 @@ static void fancy_print(MimeViewer *_viewer)
webkit_print_operation_get_print_settings(printoperation));
}
- g_free(printoperation);
+ g_object_unref(printoperation);
}
/*static gchar *fancy_get_selection (MimeViewer *_viewer)
@@ -659,6 +658,7 @@ static void load_changed_cb(WebKitWebView *view,
break;
case WEBKIT_LOAD_FINISHED:
+ viewer->loading = FALSE;
gtk_widget_hide(viewer->progress);
gtk_widget_hide(viewer->ev_stop_loading);
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(viewer->progress),