From 5d8a4ea16f86e62f1c14c5acffb075aa59e1aa5a Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 20 Apr 2002 00:41:25 +0000 Subject: Ref the html object here, this is an async handler so it's possible for 2002-04-19 Jeffrey Stedfast * mail-display.c (stream_write_or_redisplay_when_loaded): Ref the html object here, this is an async handler so it's possible for our caller (or someone else) to unref the html object before we finish. (load_content_free): Unref the async handler's ref of the html object here. (mail_display_new): Ref the html widget here so that we can be sure that so long as the mail-display is "alive", so is the html object. See bug #22328 for details. Basically, the message-browser is being closed before the message gets loaded and so the html object was being destroyed but the mail-display was still alive. (mail_display_destroy): Unref the html object when the mail-display is destroyed. svn path=/trunk/; revision=16544 --- mail/ChangeLog | 16 ++++++++++++++++ mail/mail-display.c | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index e27ff8e094..392b75c810 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,19 @@ +2002-04-19 Jeffrey Stedfast + + * mail-display.c (stream_write_or_redisplay_when_loaded): Ref the + html object here, this is an async handler so it's possible for + our caller (or someone else) to unref the html object before we + finish. + (load_content_free): Unref the async handler's ref of the html + object here. + (mail_display_new): Ref the html widget here so that we can be + sure that so long as the mail-display is "alive", so is the html + object. See bug #22328 for details. Basically, the message-browser + is being closed before the message gets loaded and so the html + object was being destroyed but the mail-display was still alive. + (mail_display_destroy): Unref the html object when the + mail-display is destroyed. + 2002-04-19 Anna Marie Dirks * mail-config.glade: Added yet more accelerators for the new config diff --git a/mail/mail-display.c b/mail/mail-display.c index a4d3ae65bd..cabab31feb 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -1355,6 +1355,7 @@ load_content_free (struct _mail_msg *mm) struct _load_content_msg *m = (struct _load_content_msg *)mm; g_free (m->url); + gtk_object_unref (GTK_OBJECT (m->html)); gtk_object_unref (GTK_OBJECT (m->display)); camel_object_unref (CAMEL_OBJECT (m->message)); } @@ -1396,6 +1397,7 @@ stream_write_or_redisplay_when_loaded (MailDisplay *md, m->display = md; gtk_object_ref (GTK_OBJECT (m->display)); m->html = html; + gtk_object_ref (GTK_OBJECT (html)); m->handle = handle; m->url = g_strdup (url); m->redisplay_counter = md->redisplay_counter; @@ -1682,7 +1684,9 @@ static void mail_display_destroy (GtkObject *object) { MailDisplay *mail_display = MAIL_DISPLAY (object); - + + gtk_object_unref (GTK_OBJECT (mail_display->html)); + g_free (mail_display->charset); g_free (mail_display->selection); g_free (mail_display->followup); @@ -2289,6 +2293,7 @@ mail_display_new (void) mail_display->scroll = E_SCROLL_FRAME (scroll); mail_display->html = GTK_HTML (html); + gtk_object_ref (GTK_OBJECT (mail_display->html)); mail_display->last_active = NULL; mail_display->data = g_new0 (GData *, 1); g_datalist_init (mail_display->data); -- cgit v1.2.3