[tracker/writeback-guarantee] tracker-writeback: Fix a memoryleak on unwanted_results and cleanup
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/writeback-guarantee] tracker-writeback: Fix a memoryleak on unwanted_results and cleanup
- Date: Thu, 16 Dec 2010 15:47:55 +0000 (UTC)
commit f9f3a6ecd5a58e810a1418edf31e2c318027bb3e
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Dec 16 16:47:34 2010 +0100
tracker-writeback: Fix a memoryleak on unwanted_results and cleanup
src/tracker-writeback/tracker-writeback-consumer.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback-consumer.c b/src/tracker-writeback/tracker-writeback-consumer.c
index 2432706..e8b00dc 100644
--- a/src/tracker-writeback/tracker-writeback-consumer.c
+++ b/src/tracker-writeback/tracker-writeback-consumer.c
@@ -196,7 +196,7 @@ sparql_query_cb_diff (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);
g_assert (cols >= 2);
@@ -252,11 +252,10 @@ sparql_query_cb_diff (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);
@@ -294,7 +293,7 @@ sparql_query_cb (GObject *object,
cursor = tracker_sparql_connection_query_finish (TRACKER_SPARQL_CONNECTION (object), result, &error);
if (!error) {
- GPtrArray *unwanted_results = g_ptr_array_new ();
+ GPtrArray *unwanted_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)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]