summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-12-17 12:15:59 +0100
committerCarlos Soriano <csoriano@gnome.org>2015-12-17 15:52:30 +0100
commit95cadccf263bfd5b17d3d94a0469ebd6cdce889a (patch)
tree17b182cd3107a5e566d0ab5b9ac22f773c485d4a
parente345fd9b1700dff5568589d8e1c07e333fd88aa6 (diff)
downloadnautilus-95cadccf263bfd5b17d3d94a0469ebd6cdce889a.tar.gz
search-engine-model: fix infinity waiting
How search works: The main engine starts. It starts in order all the search providers which start one or more threads. Then the owner of the engine can decide to stop, and therefore requesting the providers to stop. Then the providers take their time in the different threads to cancel and to report to the engine, which is the main thread, that they finished. At that point the engine signals that the engine is stopped and finished. However, if one of the search providers fail to report it's finalization the engine is hanging forever, making everything stopping to work. This was the issue when the engine requests the model provider to stop, and then start again before it got time to request the directory info, since we add the iddle but never rested it's id, so never signal a finish. This was working most of the times because, this idle is only requested when we stop the model provider and it's still running, but usually the work the model has to do is so little that always gets finished before stopping it. So to fix this issue, reset the idle id when finished. https://bugzilla.gnome.org/show_bug.cgi?id=756183
-rw-r--r--libnautilus-private/nautilus-search-engine-model.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libnautilus-private/nautilus-search-engine-model.c b/libnautilus-private/nautilus-search-engine-model.c
index 8648cf5e3..4dfb5ebd0 100644
--- a/libnautilus-private/nautilus-search-engine-model.c
+++ b/libnautilus-private/nautilus-search-engine-model.c
@@ -79,6 +79,8 @@ finalize (GObject *object)
static gboolean
search_finished (NautilusSearchEngineModel *model)
{
+ model->details->finished_id = 0;
+
if (model->details->hits != NULL) {
DEBUG ("Model engine hits added");
nautilus_search_provider_hits_added (NAUTILUS_SEARCH_PROVIDER (model),