mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
dive-list: maintain a single instance of DiveTripModel
A weird crash occurs if DiveListView creates another local instance of DiveTripModel inside reload(). Re-use the member variable tripModel and assign it a new instance of DiveTripModel. Reported-by: Gaetan Bisson <bisson@archlinux.org> Tested-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
e3118d915c
commit
52445ec8f5
1 changed files with 1 additions and 1 deletions
|
@ -427,7 +427,7 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
|
||||||
if (oldModel) {
|
if (oldModel) {
|
||||||
oldModel->deleteLater();
|
oldModel->deleteLater();
|
||||||
}
|
}
|
||||||
DiveTripModel *tripModel = new DiveTripModel(this);
|
tripModel = new DiveTripModel(this);
|
||||||
tripModel->setLayout(layout);
|
tripModel->setLayout(layout);
|
||||||
|
|
||||||
m->setSourceModel(tripModel);
|
m->setSourceModel(tripModel);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue