summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2016-03-14 23:04:12 +0100
committerCarlos Garnacho <carlosg@gnome.org>2016-03-14 23:04:12 +0100
commitd6a0f166db2f86ffcf4cb807212d2d49c4f5d067 (patch)
tree78ca4e4e09892c3734e33b48c3d709642e1ed9e5
parent65f6d8523c4af2fa09a7aef6c8d8161fa76f4642 (diff)
downloadtracker-d6a0f166db2f86ffcf4cb807212d2d49c4f5d067.tar.gz
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.
-rw-r--r--src/libtracker-miner/tracker-file-notifier.c8
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 5d58766f9..bf75130f9 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);
}