Commit 3eb23971 authored by Marco Trevisan's avatar Marco Trevisan 🎺

search-engine-recent: wait the search thread finish to change the run state

Don't unset the cancellable on stop and only consider its validity to check if the
search engine is running, otherwise if we'd nullify the instance when the search
thread is still running, we might end up in starting a new search, while the thread
has still to return its values through the idle.

Now, we rely only on the fact that the search thread will eventually join with main
thread via search_thread_add_hits_idle to notify that the search is over.
parent e076ab0b
......@@ -357,9 +357,6 @@ nautilus_search_engine_recent_stop (NautilusSearchProvider *provider)
DEBUG ("Recent engine stop");
g_cancellable_cancel (self->cancellable);
g_clear_object (&self->cancellable);
g_object_notify (G_OBJECT (provider), "running");
......@@ -378,8 +375,7 @@ nautilus_search_engine_recent_is_running (NautilusSearchProvider *provider)
NautilusSearchEngineRecent *self = NAUTILUS_SEARCH_ENGINE_RECENT (provider);
return self->cancellable != NULL &&
!g_cancellable_is_cancelled (self->cancellable);
return self->cancellable != NULL;
static void
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment