[nautilus] search-engine-model: fix infinity waiting
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] search-engine-model: fix infinity waiting
- Date: Thu, 17 Dec 2015 14:54:24 +0000 (UTC)
commit 95cadccf263bfd5b17d3d94a0469ebd6cdce889a
Author: Carlos Soriano <csoriano gnome org>
Date: Thu Dec 17 12:15:59 2015 +0100
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
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 8648cf5..4dfb5eb 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),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]