[nautilus/wip/carlosg/favorites: 2/2] search-engine: Increment providers_running early



commit 0cb4adfbedaae1a228f2b91fe2b05e753df1c667
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Nov 5 17:51:43 2017 +0100

    search-engine: Increment providers_running early
    
    There are chances that providers get to finish before all are
    added, resulting in early calls to check_providers_status() which
    mess up refcount. Bumping providers_running early prevents that
    to happen.

 src/nautilus-search-engine.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-search-engine.c b/src/nautilus-search-engine.c
index 209bd4f80..d27362e69 100644
--- a/src/nautilus-search-engine.c
+++ b/src/nautilus-search-engine.c
@@ -95,17 +95,17 @@ search_engine_start_real (NautilusSearchEngine *engine)
 
     g_object_ref (engine);
 
-    nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (priv->tracker));
     priv->providers_running++;
+    nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (priv->tracker));
 
     if (nautilus_search_engine_model_get_model (priv->model))
     {
-        nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (priv->model));
         priv->providers_running++;
+        nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (priv->model));
     }
 
-    nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (priv->simple));
     priv->providers_running++;
+    nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (priv->simple));
 }
 
 static void


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