[libgdata] [core] Reference entries when adding them to feeds
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata] [core] Reference entries when adding them to feeds
- Date: Thu, 8 Jul 2010 20:49:41 +0000 (UTC)
commit 376973f9671765fab3a89aafe5282405233d7b09
Author: Philip Withnall <philip tecnocode co uk>
Date: Thu Jul 8 21:37:34 2010 +0100
[core] Reference entries when adding them to feeds
gdata/gdata-feed.c | 3 ++-
gdata/services/documents/gdata-documents-feed.c | 1 +
2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gdata/gdata-feed.c b/gdata/gdata-feed.c
index bf1e154..4dc98c1 100644
--- a/gdata/gdata-feed.c
+++ b/gdata/gdata-feed.c
@@ -443,6 +443,7 @@ parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_da
if (data != NULL)
_gdata_feed_call_progress_callback (self, data, entry);
_gdata_feed_add_entry (self, entry);
+ g_object_unref (entry);
} else if (gdata_parser_string_from_element (node, "title", P_NO_DUPES, &(self->priv->title), &success, error) == TRUE ||
gdata_parser_string_from_element (node, "subtitle", P_NO_DUPES, &(self->priv->subtitle), &success, error) == TRUE ||
gdata_parser_string_from_element (node, "id", P_NO_DUPES, &(self->priv->id), &success, error) == TRUE ||
@@ -892,7 +893,7 @@ _gdata_feed_add_entry (GDataFeed *self, GDataEntry *entry)
{
g_return_if_fail (GDATA_IS_FEED (self));
g_return_if_fail (GDATA_IS_ENTRY (entry));
- self->priv->entries = g_list_prepend (self->priv->entries, entry);
+ self->priv->entries = g_list_prepend (self->priv->entries, g_object_ref (entry));
}
gpointer
diff --git a/gdata/services/documents/gdata-documents-feed.c b/gdata/services/documents/gdata-documents-feed.c
index 89e7f4e..24b8728 100644
--- a/gdata/services/documents/gdata-documents-feed.c
+++ b/gdata/services/documents/gdata-documents-feed.c
@@ -119,6 +119,7 @@ parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_da
/* Call the progress callback in the main thread */
_gdata_feed_call_progress_callback (GDATA_FEED (self), user_data, entry);
_gdata_feed_add_entry (GDATA_FEED (self), entry);
+ g_object_unref (entry);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]