[tracker/writeback-guarantee] tracker-writeback: Use with_free_func instead of foreach for GPtrArray
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/writeback-guarantee] tracker-writeback: Use with_free_func instead of foreach for GPtrArray
- Date: Mon, 20 Dec 2010 11:07:40 +0000 (UTC)
commit 8de14494b08753be2238f57eb370793b19ee9f5c
Author: Philip Van Hoof <philip codeminded be>
Date: Mon Dec 20 12:07:13 2010 +0100
tracker-writeback: Use with_free_func instead of foreach for GPtrArray
src/tracker-writeback/tracker-writeback-consumer.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback-consumer.c b/src/tracker-writeback/tracker-writeback-consumer.c
index 83d9a66..5e19df7 100644
--- a/src/tracker-writeback/tracker-writeback-consumer.c
+++ b/src/tracker-writeback/tracker-writeback-consumer.c
@@ -190,7 +190,7 @@ sparql_query_cb (GObject *object,
cursor = tracker_sparql_connection_query_finish (TRACKER_SPARQL_CONNECTION (object), result, &error);
if (!error) {
- GPtrArray *results = g_ptr_array_new ();
+ GPtrArray *results = g_ptr_array_new_with_free_func ((GDestroyNotify) g_strfreev);
guint cols = tracker_sparql_cursor_get_n_columns (cursor);
while (tracker_sparql_cursor_next (cursor, NULL, NULL)) {
@@ -229,11 +229,10 @@ sparql_query_cb (GObject *object,
g_object_unref (writeback);
}
}
- g_ptr_array_foreach (results, (GFunc) g_strfreev, NULL);
} else {
g_message (" No files qualify for updates");
}
- g_ptr_array_free (results, TRUE);
+ g_ptr_array_unref (results);
g_object_unref (cursor);
} else {
g_message (" No files qualify for updates (%s)", error->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]