1
0
Fork 0

Fix duplicate entries in threaded location search

This commit is contained in:
James Turner 2018-03-15 19:43:14 +01:00
parent 109a59b393
commit d92647b364
2 changed files with 9 additions and 7 deletions

View file

@ -326,6 +326,7 @@ private slots:
}
PositionedIDVec newIds = m_search->results();
if (!newIds.empty()) {
m_ids.reserve(newIds.size());
beginInsertRows(QModelIndex(), m_ids.size(), newIds.size() - 1);
for (auto id : newIds) {
@ -333,6 +334,7 @@ private slots:
m_items.push_back({}); // null ref
}
endInsertRows();
}
if (m_search->isComplete()) {
m_searchActive = false;

View file

@ -2476,7 +2476,7 @@ PositionedIDVec NavDataCache::ThreadedGUISearch::results() const
PositionedIDVec r;
{
SGGuard<SGMutex> g(d->lock);
r = d->results;
r = std::move(d->results);
}
return r;
}