[tracker] libtracker-miner: Ensure we deal with the canonical copy on ::directory-removed



commit b81950851f677fe48a356d819180f74680d0004f
Author: Carlos Garnacho <carlos lanedo com>
Date:   Mon Dec 19 14:57:42 2011 +0100

    libtracker-miner: Ensure we deal with the canonical copy on ::directory-removed
    
    A mismatch could result in tracker_crawler_stop() not being called, even if the
    directory being removed was the one currently indexed. This could be triggered
    by mounts detected during init_mount_points() in TrackerMinerFiles.

 src/libtracker-miner/tracker-file-notifier.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 6167d1d..5858c06 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -1020,7 +1020,15 @@ indexing_tree_directory_removed (TrackerIndexingTree *indexing_tree,
 	TrackerDirectoryFlags flags;
 
 	/* Flags are still valid at the moment of deletion */
-	directory = tracker_indexing_tree_get_root (indexing_tree, directory, &flags);
+	tracker_indexing_tree_get_root (indexing_tree, directory, &flags);
+	directory = tracker_file_system_peek_file (priv->file_system, directory);
+
+	if (!directory) {
+		/* If the dir has no canonical copy,
+		 * it wasn't even told to be indexed.
+		 */
+		return;
+	}
 
 	/* If the folder was being ignored, index/crawl it from scratch */
 	if (flags & TRACKER_DIRECTORY_FLAG_IGNORE) {



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