Commit 1e38a73a authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Fix potential crash if ProviderPage::fillModel() is called twice

QStandardItemModel::removeRows() actually deletes the child item,
so we should not keep a dangling pointer to it around.

BUG: 291474
FIXED-IN: 16.08.1
parent cd7894e7
......@@ -60,7 +60,10 @@ void ProviderPage::startFetchingData()
void ProviderPage::fillModel(const KNS3::Entry::List &list)
m_model->removeRows(m_model->indexFromItem(m_fetchItem).row(), 1);
if (m_fetchItem) {
m_model->removeRows(m_model->indexFromItem(m_fetchItem).row(), 1);
m_fetchItem = Q_NULLPTR;
// KNS3::Entry::Entry() is private, so we need to save the whole list.
// we can not use a QHash or whatever, as that needs that constructor...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment