From 33ffe9aadcef483a4900cc65fc9e840220951e3c Mon Sep 17 00:00:00 2001 From: bertrand Date: Wed, 11 Aug 1999 10:59:17 +0000 Subject: Message creation still consumes a lot of memory (maybe 2000k) and I really don't understand why. As soon as I get gtk working on SunOS, purify should hopefully give me the answer. 1999-08-11 bertrand * camel/camel-service.c (_finalize): * camel/camel-stream-fs.c (_finalize): (_destroy): close file descriptor. * camel/camel-stream-mem.c (_finalize): * camel/camel-store.c (_finalize): * camel/camel-folder.c (_finalize): svn path=/trunk/; revision=1104 --- camel/camel-stream-fs.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'camel/camel-stream-fs.c') diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c index a8e0dcb6c4..340a87606c 100644 --- a/camel/camel-stream-fs.c +++ b/camel/camel-stream-fs.c @@ -43,11 +43,15 @@ 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 _destroy (GtkObject *object); static void camel_stream_fs_class_init (CamelStreamFsClass *camel_stream_fs_class) { CamelStreamClass *camel_stream_class = CAMEL_STREAM_CLASS (camel_stream_fs_class); + GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (camel_stream_fs_class); + parent_class = gtk_type_class (gtk_object_get_type ()); /* virtual method definition */ @@ -61,6 +65,9 @@ camel_stream_fs_class_init (CamelStreamFsClass *camel_stream_fs_class) camel_stream_class->close = _close; camel_stream_class->seek = _seek; + gtk_object_class->finalize = _finalize; + gtk_object_class->finalize = _destroy; + } @@ -90,6 +97,39 @@ camel_stream_fs_get_type (void) } +static void +_destroy (GtkObject *object) +{ + CamelStreamFs *stream_fs = CAMEL_STREAM_FS (object); + gint close_error; + + CAMEL_LOG_FULL_DEBUG ("Entering CamelStreamFs::destroy\n"); + + close_error = close (stream_fs->fd); + if (close_error) { + CAMEL_LOG_FULL_DEBUG ("CamelStreamFs::destroy Error while closing file descriptor\n"); + CAMEL_LOG_FULL_DEBUG ( " Full error text is : %s\n", strerror(errno)); + } + GTK_OBJECT_CLASS (parent_class)->destroy (object); + CAMEL_LOG_FULL_DEBUG ("Leaving CamelStreamFs::destroy\n"); +} + + +static void +_finalize (GtkObject *object) +{ + CamelStreamFs *stream_fs = CAMEL_STREAM_FS (object); + + + CAMEL_LOG_FULL_DEBUG ("Entering CamelStreamFs::finalize\n"); + + if (stream_fs->name) g_free (stream_fs->name); + + GTK_OBJECT_CLASS (parent_class)->finalize (object); + CAMEL_LOG_FULL_DEBUG ("Leaving CamelStreamFs::finalize\n"); +} + + CamelStream * camel_stream_fs_new_with_name (gchar *name, CamelStreamFsMode mode) { -- cgit v1.2.3