Skip to content
  • Carlos Soriano Sánchez's avatar
    search-engine-model: fix infinity waiting · 95cadccf
    Carlos Soriano Sánchez authored
    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
    95cadccf