diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-10-04 03:52:02 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-10-03 21:34:43 -0700 |
commit | 52445ec8f5bb957a41c6650982e69c96174eee8a (patch) | |
tree | a76e3128f7ed86a927412906096a7c7e7334ac2b /desktop-widgets/divelistview.cpp | |
parent | e3118d915cf49de4cc722522031b0be44014d790 (diff) | |
download | subsurface-52445ec8f5bb957a41c6650982e69c96174eee8a.tar.gz |
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>
Diffstat (limited to 'desktop-widgets/divelistview.cpp')
-rw-r--r-- | desktop-widgets/divelistview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index 0b6386efd..906563d7e 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -427,7 +427,7 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort) if (oldModel) { oldModel->deleteLater(); } - DiveTripModel *tripModel = new DiveTripModel(this); + tripModel = new DiveTripModel(this); tripModel->setLayout(layout); m->setSourceModel(tripModel); |