diff --git a/src/GUI/LocationWidget.cxx b/src/GUI/LocationWidget.cxx index 39ab99fee..da66a5900 100644 --- a/src/GUI/LocationWidget.cxx +++ b/src/GUI/LocationWidget.cxx @@ -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; diff --git a/src/Navaids/NavDataCache.cxx b/src/Navaids/NavDataCache.cxx index ba2a77f1d..6357ca148 100644 --- a/src/Navaids/NavDataCache.cxx +++ b/src/Navaids/NavDataCache.cxx @@ -2476,7 +2476,7 @@ PositionedIDVec NavDataCache::ThreadedGUISearch::results() const PositionedIDVec r; { SGGuard g(d->lock); - r = d->results; + r = std::move(d->results); } return r; }