Avoid a memory leak

pull/541/head
Capostrophic 6 years ago
parent e14ada8f36
commit 2fbed21f83

@ -413,7 +413,7 @@ void ContentSelectorModel::ContentModel::addFile(EsmFile *file)
if (!mFiles.at(row)->fileName().compare(file->fileName(), Qt::CaseInsensitive)) if (!mFiles.at(row)->fileName().compare(file->fileName(), Qt::CaseInsensitive))
{ {
beginRemoveRows(QModelIndex(), row, row); beginRemoveRows(QModelIndex(), row, row);
mFiles.removeAt(row); delete mFiles.takeAt(row);
endRemoveRows(); endRemoveRows();
emit dataChanged(index(row, 0), index(mFiles.size(), 0)); emit dataChanged(index(row, 0), index(mFiles.size(), 0));
break; break;

Loading…
Cancel
Save