From de8c6c1bdc0f70e13f9d5e1212b783641b633df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Wed, 16 May 2012 19:05:38 +0200 Subject: Bug #673514 - Crash in WebKit after printing --- mail/e-mail-reader-utils.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index afc7e3748c..0a8e358938 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -491,10 +491,15 @@ printing_done_cb (EMailPrinter *printer, /* Set activity as completed, and keep it displayed for a few seconds * so that user can actually see the the printing was sucesfully finished. */ e_activity_set_state (activity, E_ACTIVITY_COMPLETED); + + /* We can't destroy the printer and associated WebKitWebView directly from + * here, because this callback is a handler of a WebKit's signal. This + * will destroy the printer later, together with the activity */ + g_object_set_data_full (G_OBJECT (activity), + "printer", printer, (GDestroyNotify) g_object_unref); + g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, 3, (GSourceFunc) destroy_printing_activity, activity, NULL); - - g_object_unref (printer); } void -- cgit v1.2.3