From 207a1395e10cbce4f9ec3baa33a649fb9a151a27 Mon Sep 17 00:00:00 2001 From: bertrand Date: Wed, 8 Mar 2000 19:53:31 +0000 Subject: plug mem leaks due to bad documentation of 2000-03-07 bertrand * camel-formatter.c (handle_mime_part): plug mem leaks due to bad documentation of camel_content_field_get_mime_type (print_camel_body_part): idem (handle_multipart_alternative): idem * gmime-content-field.c (gmime_content_field_get_mime_type): documentation fix. * camel-mime-part.c (my_finalize): unref the content_input_stream if any. * shell/e-shell-shortcut.c (shortcut_bar_item_selected): removed a test that prevented the standard menu to be shown. svn path=/trunk/; revision=2089 --- mail/mail-display.c | 17 ++++++++++++----- mail/mail-display.h | 1 + mail/message-list.h | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'mail') diff --git a/mail/mail-display.c b/mail/mail-display.c index 6665d8dd48..3f5cbd2bcf 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -250,6 +250,12 @@ mail_display_set_message (MailDisplay *mail_display, */ if (CAMEL_IS_MIME_MESSAGE (medium)) { + /* we were given a reference to the message in the last call + * to mail_display_set_message, free it now. */ + if (mail_display->current_message) + gtk_object_unref (GTK_OBJECT (mail_display->current_message)); + + mail_display->current_message = CAMEL_MIME_MESSAGE (medium); /* * reset the html stream to clean * the gtkhtml widget @@ -287,13 +293,11 @@ mail_display_set_message (MailDisplay *mail_display, CAMEL_MIME_MESSAGE (medium), mail_display->headers_stream, mail_display->body_stream); + - - /*camel_formatter_wrapper_to_html (camel_formatter, - CAMEL_DATA_WRAPPER (medium), - mail_display->body_stream);*/ + gtk_object_unref (GTK_OBJECT (camel_formatter)); - camel_stream_write_string (mail_display->headers_stream, " + camel_stream_write_string (mail_display->headers_stream, " @@ -333,6 +337,9 @@ mail_display_init (GtkObject *object) mail_display->body_stream = html_stream_new (mail_display->body_html_widget); gtk_widget_show (GTK_WIDGET (mail_display->body_html_widget)); + + /* various other initializations */ + mail_display->current_message = NULL; } static void diff --git a/mail/mail-display.h b/mail/mail-display.h index 804be904f8..81f1bcb38f 100644 --- a/mail/mail-display.h +++ b/mail/mail-display.h @@ -38,6 +38,7 @@ struct _MailDisplay { GtkHTML * body_html_widget; CamelStream * body_stream; + CamelMimeMessage *current_message; }; typedef struct { diff --git a/mail/message-list.h b/mail/message-list.h index 16e60c21f0..f045037313 100644 --- a/mail/message-list.h +++ b/mail/message-list.h @@ -59,6 +59,7 @@ struct _MessageList { CamelFolder *folder; CamelFolderSummary *folder_summary; + } ; typedef struct { -- cgit