Fix crasher when updating the comics model

This commit is contained in:
Luis Ángel San Martín 2024-11-03 14:48:37 +01:00
parent 611880aba8
commit 72535ffc98

View File

@ -897,12 +897,12 @@ void ComicModel::takeUpdatedData(const QList<ComicItem *> &updatedData, std::fun
i++; i++;
} }
// remove remaining comics { // remove remaining comics
for (; i < length; i++) { for (int k = length - 1; k >= i; k--) {
beginRemoveRows(QModelIndex(), i, i); beginRemoveRows(QModelIndex(), k, k);
delete _data.at(i); delete _data.at(k);
_data.removeAt(i); _data.removeAt(k);
endRemoveRows(); endRemoveRows();
} }