diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-07-11 06:49:14 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-07-11 06:49:14 +0800 |
commit | 740bddaf619c705fe421c295a5451ad7a2422cc8 (patch) | |
tree | 1c2d491ece2ff0e2b84eae1099e2b58357d0c2d9 /mail/mail-display.c | |
parent | 4a0a53ce2da2d4d8c5d9949102670f1642e614d2 (diff) | |
download | gsoc2013-evolution-740bddaf619c705fe421c295a5451ad7a2422cc8.tar.gz gsoc2013-evolution-740bddaf619c705fe421c295a5451ad7a2422cc8.tar.zst gsoc2013-evolution-740bddaf619c705fe421c295a5451ad7a2422cc8.zip |
If we unref'd a current_message, clear the datalist. Don't bother
2002-07-10 Jeffrey Stedfast <fejj@ximian.com>
* 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
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r-- | mail/mail-display.c | 21 |
1 files changed, 6 insertions, 15 deletions
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; |