Fix duplicate entries in threaded location search
This commit is contained in:
parent
109a59b393
commit
d92647b364
2 changed files with 9 additions and 7 deletions
|
@ -326,13 +326,15 @@ private slots:
|
|||
}
|
||||
|
||||
PositionedIDVec newIds = m_search->results();
|
||||
m_ids.reserve(newIds.size());
|
||||
beginInsertRows(QModelIndex(), m_ids.size(), newIds.size() - 1);
|
||||
for (auto id : newIds) {
|
||||
m_ids.push_back(id);
|
||||
m_items.push_back({}); // null ref
|
||||
if (!newIds.empty()) {
|
||||
m_ids.reserve(newIds.size());
|
||||
beginInsertRows(QModelIndex(), m_ids.size(), newIds.size() - 1);
|
||||
for (auto id : newIds) {
|
||||
m_ids.push_back(id);
|
||||
m_items.push_back({}); // null ref
|
||||
}
|
||||
endInsertRows();
|
||||
}
|
||||
endInsertRows();
|
||||
|
||||
if (m_search->isComplete()) {
|
||||
m_searchActive = false;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue