[tracker] libtracker-miner: Do not free the current root data automatically on interruption



commit aa68cd9cea0e5f84314a76da71f0a8268571c90b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue May 3 01:08:07 2016 +0200

    libtracker-miner: Do not free the current root data automatically on interruption
    
    Most interruption cases are global to a RootData (eg. unmounts). It however
    may turn out with unexpected consequences when requesting crawling of a
    subfolder that is being deleted. In that case we'd expect the RootData to
    be preserved and crawling to resume on the remaining folders.
    
    So, only delete the current root data across regular operations as long
    as we're not being interrupted, and ensure we do so manually in all the
    cases where tracker_crawler_stop() is manually called.

 src/libtracker-miner/tracker-file-notifier.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index ce97f84..d3fde03 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -707,11 +707,12 @@ finish_current_directory (TrackerFileNotifier *notifier,
                        priv->current_index_root->files_found,
                        priv->current_index_root->files_ignored);
 
-               root_data_free (priv->current_index_root);
-               priv->current_index_root = NULL;
+               if (!interrupted) {
+                       root_data_free (priv->current_index_root);
+                       priv->current_index_root = NULL;
 
-               if (!interrupted)
                        notifier_check_next_root (notifier);
+               }
        }
 
        g_object_unref (directory);
@@ -1842,6 +1843,11 @@ tracker_file_notifier_stop (TrackerFileNotifier *notifier)
        if (!priv->stopped) {
                tracker_crawler_stop (priv->crawler);
 
+               if (priv->current_index_root) {
+                       root_data_free (priv->current_index_root);
+                       priv->current_index_root = NULL;
+               }
+
                g_cancellable_cancel (priv->cancellable);
                priv->stopped = TRUE;
        }


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