Remove *and* delete items once no longer in results

There was a memory leak: i was not deleting the elements from the QList
once they are no longer in the results of the SQL query.
This commit is contained in:
jordi fita mas 2025-01-15 13:04:35 +01:00
parent 0e371d71dd
commit ed56ba543d
1 changed files with 1 additions and 0 deletions

View File

@ -154,6 +154,7 @@ void TimelineListModel::fetch()
}
if (itemsRow < m_items.count()) {
beginRemoveRows({}, itemsRow, m_items.count() - 1);
qDeleteAll(m_items.begin() + itemsRow, m_items.end());
m_items.remove(itemsRow, m_items.count() - itemsRow);
endRemoveRows();
}