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 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'mail/mail-display.c') 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 -- cgit v1.2.3