[tracker] Take ownership of the GFile in the GPtrArray



commit 6ccf4711a1cafee3457d478a27c9a5510fc40d1d
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Oct 27 13:34:43 2014 +0100

    Take ownership of the GFile in the GPtrArray

 src/libtracker-miner/tracker-file-notifier.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index f28c0f8..a858fbc 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -160,7 +160,7 @@ root_data_new (TrackerFileNotifier *notifier,
        data = g_new0 (RootData, 1);
        data->root = g_object_ref (file);
        data->pending_dirs = g_queue_new ();
-       data->query_files = g_ptr_array_new ();
+       data->query_files = g_ptr_array_new_with_free_func (g_object_unref);
        data->updated_dirs = g_ptr_array_new ();
        data->flags = flags;
 
@@ -426,7 +426,7 @@ file_notifier_add_node_foreach (GNode    *node,
 
                if (depth != 0 || file == priv->current_index_root->root)
                        g_ptr_array_add (priv->current_index_root->query_files,
-                                        canonical);
+                                        g_object_ref (canonical));
        }
 
        return FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]