[libgdata/libgdata-0-7] documents: Fix a memory leak in GDataDocumentsQuery
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata/libgdata-0-7] documents: Fix a memory leak in GDataDocumentsQuery
- Date: Fri, 10 Dec 2010 22:39:36 +0000 (UTC)
commit 72329e544a330ef47c0c9afd60559c29de46d4cf
Author: Philip Withnall <philip tecnocode co uk>
Date: Thu Dec 9 18:46:39 2010 +0000
documents: Fix a memory leak in GDataDocumentsQuery
gdata/services/documents/gdata-documents-query.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/gdata/services/documents/gdata-documents-query.c b/gdata/services/documents/gdata-documents-query.c
index d2452fe..4ccd10e 100644
--- a/gdata/services/documents/gdata-documents-query.c
+++ b/gdata/services/documents/gdata-documents-query.c
@@ -47,6 +47,7 @@
#include <gdata/services/documents/gdata-documents-text.h>
#include <gdata/services/documents/gdata-documents-folder.h>
+static void gdata_documents_query_dispose (GObject *object);
static void gdata_documents_query_finalize (GObject *object);
static void gdata_documents_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
static void gdata_documents_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
@@ -82,6 +83,7 @@ gdata_documents_query_class_init (GDataDocumentsQueryClass *klass)
gobject_class->get_property = gdata_documents_query_get_property;
gobject_class->set_property = gdata_documents_query_set_property;
+ gobject_class->dispose = gdata_documents_query_dispose;
gobject_class->finalize = gdata_documents_query_finalize;
query_class->get_query_uri = get_query_uri;
@@ -160,6 +162,25 @@ gdata_documents_query_init (GDataDocumentsQuery *self)
}
static void
+gdata_documents_query_dispose (GObject *object)
+{
+ GList *i;
+ GDataDocumentsQueryPrivate *priv = GDATA_DOCUMENTS_QUERY (object)->priv;
+
+ for (i = priv->collaborator_addresses; i != NULL; i = i->next)
+ g_object_unref (i->data);
+ g_list_free (priv->collaborator_addresses);
+ priv->collaborator_addresses = NULL;
+
+ for (i = priv->reader_addresses; i != NULL; i = i->next)
+ g_object_unref (i->data);
+ g_list_free (priv->reader_addresses);
+ priv->reader_addresses = NULL;
+
+ G_OBJECT_CLASS (gdata_documents_query_parent_class)->dispose (object);
+}
+
+static void
gdata_documents_query_finalize (GObject *object)
{
GDataDocumentsQueryPrivate *priv = GDATA_DOCUMENTS_QUERY (object)->priv;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]