aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-stream-mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-stream-mem.c')
-rw-r--r--camel/camel-stream-mem.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/camel/camel-stream-mem.c b/camel/camel-stream-mem.c
index 2fa2c7c306..592caa5063 100644
--- a/camel/camel-stream-mem.c
+++ b/camel/camel-stream-mem.c
@@ -43,11 +43,14 @@ static gboolean _eos (CamelStream *stream);
static void _close (CamelStream *stream);
static gint _seek (CamelStream *stream, gint offset, CamelStreamSeekPolicy policy);
+static void _finalize (GtkObject *object);
static void
camel_stream_mem_class_init (CamelStreamMemClass *camel_stream_mem_class)
{
CamelStreamClass *camel_stream_class = CAMEL_STREAM_CLASS (camel_stream_mem_class);
+ GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (camel_stream_mem_class);
+
parent_class = gtk_type_class (gtk_object_get_type ());
/* virtual method definition */
@@ -61,6 +64,8 @@ camel_stream_mem_class_init (CamelStreamMemClass *camel_stream_mem_class)
camel_stream_class->close = _close;
camel_stream_class->seek = _seek;
+ gtk_object_class->finalize = _finalize;
+
}
static void
@@ -106,6 +111,20 @@ camel_stream_mem_new (CamelStreamMemMode mode)
return CAMEL_STREAM (stream_mem);
}
+static void
+_finalize (GtkObject *object)
+{
+ CamelStreamMem *stream_mem = CAMEL_STREAM_MEM (object);
+
+
+ CAMEL_LOG_FULL_DEBUG ("Entering CamelStreamMem::finalize\n");
+ g_byte_array_free (stream_mem->buffer, TRUE);
+
+ GTK_OBJECT_CLASS (parent_class)->finalize (object);
+ CAMEL_LOG_FULL_DEBUG ("Leaving CamelStreamMem::finalize\n");
+}
+
+
/**
* _read: read bytes from a stream