[tracker] libtracker-miner: Ensure the directory root is removed when its indexing root is



commit d6a0f166db2f86ffcf4cb807212d2d49c4f5d067
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 14 23:04:12 2016 +0100

    libtracker-miner: Ensure the directory root is removed when its indexing root is
    
    If the directory is currently being inspected, and in the query (rather
    than crawling) phase, TrackerCrawler::finished won't be called, so the
    current index root might not be cleared yet.
    
    This code is very similar to file_notifier_current_root_check_remove_directory,
    and the same considerations apply.

 src/libtracker-miner/tracker-file-notifier.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 5d58766..bf75130 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -1483,6 +1483,14 @@ indexing_tree_directory_removed (TrackerIndexingTree *indexing_tree,
                tracker_crawler_stop (priv->crawler);
                g_cancellable_cancel (priv->cancellable);
 
+               /* If the crawler was already stopped (eg. we're at the querying
+                * phase), the current index root won't be cleared.
+                */
+               if (priv->current_index_root) {
+                       root_data_free (priv->current_index_root);
+                       priv->current_index_root = NULL;
+               }
+
                notifier_check_next_root (notifier);
        }
 


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