1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-28 07:46:37 -04:00

MainWindow: use pop_back() to remove last element of vector

This commit is contained in:
f4exb 2021-12-04 10:54:19 +01:00
parent fcdeffa59c
commit bb1f833d02

View File

@ -683,7 +683,7 @@ void MainWindow::removeFeatureSet(unsigned int tabIndex)
if (tabIndex < m_featureUIs.size()) if (tabIndex < m_featureUIs.size())
{ {
delete m_featureUIs[tabIndex]; delete m_featureUIs[tabIndex];
m_featureUIs.erase(m_featureUIs.begin() + tabIndex); m_featureUIs.pop_back();
m_mainCore->removeFeatureSet(tabIndex); m_mainCore->removeFeatureSet(tabIndex);
} }
} }
@ -693,7 +693,8 @@ void MainWindow::removeAllFeatureSets()
while (m_featureUIs.size() > 0) while (m_featureUIs.size() > 0)
{ {
delete m_featureUIs.back(); delete m_featureUIs.back();
m_featureUIs.erase(std::prev(m_featureUIs.end())); m_featureUIs.pop_back();
m_mainCore->removeLastFeatureSet();
} }
} }