From 740bddaf619c705fe421c295a5451ad7a2422cc8 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 10 Jul 2002 22:49:14 +0000 Subject: If we unref'd a current_message, clear the datalist. Don't bother 2002-07-10 Jeffrey Stedfast * mail-display.c (mail_display_set_message): If we unref'd a current_message, clear the datalist. Don't bother connecting to the message's finalise signal because something else may own a ref to the original message when we replace it with a new one. (mail_display_destroy): Only clear the datalist if we have a current_message, otherwise it's safe to assume that it is already cleared. svn path=/trunk/; revision=17413 --- mail/ChangeLog | 10 ++++++++++ mail/mail-display.c | 21 ++++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index ff9f00b287..c2717da744 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2002-07-10 Jeffrey Stedfast + + * mail-display.c (mail_display_set_message): If we unref'd a + current_message, clear the datalist. Don't bother connecting to + the message's finalise signal because something else may own a ref + to the original message when we replace it with a new one. + (mail_display_destroy): Only clear the datalist if we have a + current_message, otherwise it's safe to assume that it is already + cleared. + 2002-07-08 Peter Williams * Makefile.am (INCLUDES): Add -I flags to get the ebook headers. diff --git a/mail/mail-display.c b/mail/mail-display.c index b5e57f6015..ca896234ff 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -1477,14 +1477,6 @@ mail_error_printf (GtkHTML *html, GtkHTMLStream *stream, g_free (htmltext); } -static void -clear_data (CamelObject *object, gpointer event_data, gpointer user_data) -{ - GData *data = user_data; - - g_datalist_clear (&data); -} - #define COLOR_IS_LIGHT(r, g, b) ((r + g + b) > (128 * 3)) @@ -1621,8 +1613,10 @@ mail_display_set_message (MailDisplay *md, CamelMedium *medium, const char *foll return; /* Clean up from previous message. */ - if (md->current_message) + if (md->current_message) { camel_object_unref (CAMEL_OBJECT (md->current_message)); + g_datalist_clear (md->data); + } g_free (md->followup); @@ -1636,10 +1630,6 @@ mail_display_set_message (MailDisplay *md, CamelMedium *medium, const char *foll g_datalist_init (md->data); mail_display_redisplay (md, TRUE); - if (medium) { - camel_object_hook_event (CAMEL_OBJECT (medium), "finalize", - clear_data, *(md->data)); - } } /** @@ -1706,14 +1696,15 @@ mail_display_destroy (GtkObject *object) gtk_object_unref (GTK_OBJECT (mail_display->html)); - if (mail_display->current_message) + if (mail_display->current_message) { camel_object_unref (mail_display->current_message); + g_datalist_clear (mail_display->data); + } g_free (mail_display->charset); g_free (mail_display->selection); g_free (mail_display->followup); - g_datalist_clear (mail_display->data); g_free (mail_display->data); mail_display->data = NULL; -- cgit