aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-data-wrapper.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-data-wrapper.c
parent7d7f5423308313eb30558700598091b4ba1f0d20 (diff)
downloadgsoc2013-evolution-9d041c9464b7e13cce7368e644781971d9ad5501.tar
gsoc2013-evolution-9d041c9464b7e13cce7368e644781971d9ad5501.tar.gz
gsoc2013-evolution-9d041c9464b7e13cce7368e644781971d9ad5501.tar.bz2
gsoc2013-evolution-9d041c9464b7e13cce7368e644781971d9ad5501.tar.lz
gsoc2013-evolution-9d041c9464b7e13cce7368e644781971d9ad5501.tar.xz
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-data-wrapper.c')
-rw-r--r--camel/camel-data-wrapper.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/camel/camel-data-wrapper.c b/camel/camel-data-wrapper.c
index ef8c325293..579f32f023 100644
--- a/camel/camel-data-wrapper.c
+++ b/camel/camel-data-wrapper.c
@@ -38,11 +38,13 @@ static void _set_mime_type (CamelDataWrapper *data_wrapper, gchar *mime_type);
static gchar *_get_mime_type (CamelDataWrapper *data_wrapper);
static GMimeContentField *_get_mime_type_field (CamelDataWrapper *data_wrapper);
static void _set_mime_type_field (CamelDataWrapper *data_wrapper, GMimeContentField *mime_type);
-
+static void _finalize (GtkObject *object);
static void
camel_data_wrapper_class_init (CamelDataWrapperClass *camel_data_wrapper_class)
{
+ GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (camel_data_wrapper_class);
+
parent_class = gtk_type_class (gtk_object_get_type ());
/* virtual method definition */
@@ -52,7 +54,9 @@ camel_data_wrapper_class_init (CamelDataWrapperClass *camel_data_wrapper_class)
camel_data_wrapper_class->get_mime_type = _get_mime_type;
camel_data_wrapper_class->get_mime_type_field = _get_mime_type_field;
camel_data_wrapper_class->set_mime_type_field = _set_mime_type_field;
+
/* virtual method overload */
+ gtk_object_class->finalize = _finalize;
}
@@ -96,6 +100,20 @@ camel_data_wrapper_get_type (void)
}
+static void
+_finalize (GtkObject *object)
+{
+ CamelDataWrapper *camel_data_wrapper = CAMEL_DATA_WRAPPER (object);
+
+ CAMEL_LOG_FULL_DEBUG ("Entering CamelDataWrapper::finalize\n");
+ printf ("CamelDataWrapper::finalize, finalizing object %p\n", object);
+ if (camel_data_wrapper->mime_type)
+ gmime_content_field_unref (camel_data_wrapper->mime_type);
+
+ parent_class->finalize (object);
+ CAMEL_LOG_FULL_DEBUG ("Leaving CamelDataWrapper::finalize\n");
+}
+
/**
* _write_to_stream: write data content in a byte stream