Commit 95cadccf authored by Carlos Soriano Sánchez's avatar Carlos Soriano Sánchez
Browse files

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
At that point the engine signals that the engine is stopped and

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.
parent e345fd9b
......@@ -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),
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