aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-message.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>1999-08-11 07:22:44 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-08-11 07:22:44 +0800
commit9d041c9464b7e13cce7368e644781971d9ad5501 (patch)
treea7671cef07919885cb61baa31cade7bdccaa7a1e /camel/camel-mime-message.c
parent7d7f5423308313eb30558700598091b4ba1f0d20 (diff)
downloadgsoc2013-evolution-9d041c9464b7e13cce7368e644781971d9ad5501.tar.gz
gsoc2013-evolution-9d041c9464b7e13cce7368e644781971d9ad5501.tar.zst
gsoc2013-evolution-9d041c9464b7e13cce7368e644781971d9ad5501.zip
implemented destructors.
1999-08-11 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-multipart.c (_finalize): * camel/camel-simple-data-wrapper.c (_finalize): * camel/camel-mime-part.c (_finalize): implemented destructors. * camel/gmime-content-field.c (gmime_content_field_ref): (gmime_content_field_unref): New reference mechanism for GMimeContentField objects. * camel/camel-data-wrapper.c (_finalize): Started implementing destructors. * camel/camel-mime-part.c (_construct_from_stream): * camel/gmime-content-field.c (gmime_content_field_write_to_stream): * camel/camel-multipart.c (_construct_from_stream): removed forgotten anarchic traces. Go away memory leaks! svn path=/trunk/; revision=1103
Diffstat (limited to 'camel/camel-mime-message.c')
-rw-r--r--camel/camel-mime-message.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index a6ff2482a6..1563c0cb1d 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -74,6 +74,8 @@ static guint _get_message_number (CamelMimeMessage *mime_message);
static void _write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
static gboolean _parse_header_pair (CamelMimePart *mime_part, gchar *header_name, gchar *header_value);
+static void _finalize (GtkObject *object);
+
/* Returns the class for a CamelMimeMessage */
#define CMM_CLASS(so) CAMEL_MIME_MESSAGE_CLASS (GTK_OBJECT(so)->klass)
#define CDW_CLASS(so) CAMEL_DATA_WRAPPER_CLASS (GTK_OBJECT(so)->klass)
@@ -97,6 +99,7 @@ camel_mime_message_class_init (CamelMimeMessageClass *camel_mime_message_class)
{
CamelDataWrapperClass *camel_data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (camel_mime_message_class);
CamelMimePartClass *camel_mime_part_class = CAMEL_MIME_PART_CLASS (camel_mime_message_class);
+ GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (camel_data_wrapper_class);
parent_class = gtk_type_class (camel_mime_part_get_type ());
_init_header_name_table();
@@ -129,6 +132,7 @@ camel_mime_message_class_init (CamelMimeMessageClass *camel_mime_message_class)
camel_data_wrapper_class->write_to_stream = _write_to_stream;
camel_mime_part_class->parse_header_pair = _parse_header_pair;
+ gtk_object_class->finalize = _finalize;
}
@@ -168,12 +172,36 @@ camel_mime_message_get_type (void)
}
+static void
+_finalize (GtkObject *object)
+{
+ CamelMimeMessage *message = CAMEL_MIME_MESSAGE (object);
+
+ CAMEL_LOG_FULL_DEBUG ("Entering CamelMimeMessage::finalize\n");
+ if (message->received_date) g_free (message->received_date);
+ if (message->sent_date) g_free (message->sent_date);
+ if (message->subject) g_free (message->subject);
+ if (message->reply_to) g_free (message->reply_to);
+ if (message->from) g_free (message->from);
+
+#warning free recipients and flags.
+ if (message->folder) gtk_object_unref (GTK_OBJECT (message->folder));
+ if (message->session) gtk_object_unref (GTK_OBJECT (message->session));
+
+ GTK_OBJECT_CLASS (parent_class)->finalize (object);
+ CAMEL_LOG_FULL_DEBUG ("Leaving CamelMimeMessage::finalize\n");
+}
+
+
+
CamelMimeMessage *
camel_mime_message_new_with_session (CamelSession *session)
{
CamelMimeMessage *mime_message;
mime_message = gtk_type_new (CAMEL_MIME_MESSAGE_TYPE);
mime_message->session = session;
+ if (session) gtk_object_ref (GTK_OBJECT (session));
+
return mime_message;
}