diff options
author | Carlos Soriano <csoriano@gnome.org> | 2015-12-17 12:15:59 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2016-01-18 11:00:15 +0100 |
commit | 8824fcdf6f06385ee9e20d2edbbc81a8ada8f894 (patch) | |
tree | a972c627c5573e11fd06a6c210f25c690c520dc8 | |
parent | 1caf8a6ec1e4a0090ab0aeae8bc2b747b243d722 (diff) | |
download | nautilus-8824fcdf6f06385ee9e20d2edbbc81a8ada8f894.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.c | 2 |
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), |