[evolution] Bug #673514 - Crash in WebKit after printing



commit de8c6c1bdc0f70e13f9d5e1212b783641b633df0
Author: Dan VrÃtil <dvratil redhat com>
Date:   Wed May 16 19:05:38 2012 +0200

    Bug #673514 - Crash in WebKit after printing

 mail/e-mail-reader-utils.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index afc7e37..0a8e358 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]