[tracker-miners/wip/carlosg/shuffle-libtracker-miner: 76/116] libtracker-miner: Unparent children on TrackerFileSystem root dispose
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/shuffle-libtracker-miner: 76/116] libtracker-miner: Unparent children on TrackerFileSystem root dispose
- Date: Thu, 12 Dec 2019 10:22:30 +0000 (UTC)
commit e356abb94c14455d74bb04dcdb1e93f69adb1f53
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Sep 8 13:38:03 2018 +0200
libtracker-miner: Unparent children on TrackerFileSystem root dispose
We unparented children on intermediate folders, but didn't handle the
case of the root folder disappearing. Unparent the child nodes so
they get correctly freed when the respective GFiles are disposed.
src/libtracker-miner/tracker-file-system.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-system.c b/src/libtracker-miner/tracker-file-system.c
index 6c42e6a40..961da4714 100644
--- a/src/libtracker-miner/tracker-file-system.c
+++ b/src/libtracker-miner/tracker-file-system.c
@@ -464,10 +464,6 @@ reparent_child_nodes_to_parent (GNode *node)
FileNodeData *node_data;
GNode *child, *parent;
- if (!node->parent) {
- return;
- }
-
parent = node->parent;
node_data = node->data;
child = g_node_first_child (node);
@@ -489,8 +485,12 @@ reparent_child_nodes_to_parent (GNode *node)
data->uri_prefix = uri_prefix;
g_node_unlink (cur);
- g_node_prepend (parent, cur);
+
+ if (parent)
+ g_node_prepend (parent, cur);
}
+
+ g_assert (!g_node_first_child (node));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]