Skip to content

Commit

Permalink
Fix sidebar pending queries counter after 738c10d
Browse files Browse the repository at this point in the history
The optimization changes of 738c10d could leave the m_pendingQueries
counter in inconsistent change, because it was resetted to 0 too early.
In practice, this would cause OnQueriesFinished() to be called when they
weren't yet finished.
  • Loading branch information
vslavik committed Oct 21, 2015
1 parent fb2d65f commit eb81e5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sidebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ void SuggestionsSidebarBlock::ReportError(SuggestionsBackend*, std::exception_pt

void SuggestionsSidebarBlock::ClearSuggestions()
{
m_pendingQueries = 0;
m_suggestions.clear();
UpdateSuggestionsMenu();
UpdateVisibility();
Expand Down Expand Up @@ -661,6 +660,8 @@ void SuggestionsSidebarBlock::UpdateSuggestionsForItem(CatalogItemPtr item)
return;
}

m_pendingQueries = 0;

auto srclang = m_parent->GetCurrentSourceLanguage();
auto lang = m_parent->GetCurrentLanguage();
if (!srclang.IsValid() || !lang.IsValid() || srclang == lang)
Expand Down

0 comments on commit eb81e5a

Please sign in to comment.