[tracker] libtracker-miner: Mark nodes being removed



commit 60368597d8f364e325040f9902bb765b22a889e1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Aug 19 23:52:38 2015 +0200

    libtracker-miner: Mark nodes being removed
    
    We don't want to recurse on these, this turns the last
    tracker_indexing_tree_remove() call a no-op if happens to be called
    recursively within a ::directory-removed signal handler.

 src/libtracker-miner/tracker-indexing-tree.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-indexing-tree.c b/src/libtracker-miner/tracker-indexing-tree.c
index 6d9fc37..d128fb3 100644
--- a/src/libtracker-miner/tracker-indexing-tree.c
+++ b/src/libtracker-miner/tracker-indexing-tree.c
@@ -42,6 +42,7 @@ struct _NodeData
        GFile *file;
        guint flags;
        guint shallow : 1;
+       guint removing : 1;
 };
 
 struct _PatternData
@@ -567,6 +568,12 @@ tracker_indexing_tree_remove (TrackerIndexingTree *tree,
 
        data = node->data;
 
+       if (data->removing) {
+               return;
+       }
+
+       data->removing = TRUE;
+
        if (!node->parent) {
                /* Node is the config tree
                 * root, mark as shallow again


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