mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Cleanup: Don't defer deletion of oldModel in DiveListView::reload()
There seems to be no point in using deleteLater() of the previous model. Set the new model and delete the old one. This fixes a crash with Qt 5.11. Tested-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
86ab5a91f7
commit
a76f15f0f6
1 changed files with 2 additions and 3 deletions
|
@ -425,13 +425,12 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
|
|||
|
||||
QSortFilterProxyModel *m = qobject_cast<QSortFilterProxyModel *>(model());
|
||||
QAbstractItemModel *oldModel = m->sourceModel();
|
||||
if (oldModel) {
|
||||
oldModel->deleteLater();
|
||||
}
|
||||
tripModel = new DiveTripModel(this);
|
||||
tripModel->setLayout(layout);
|
||||
|
||||
m->setSourceModel(tripModel);
|
||||
if (oldModel)
|
||||
delete oldModel;
|
||||
|
||||
if (!forceSort)
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue