From 52445ec8f5bb957a41c6650982e69c96174eee8a Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Wed, 4 Oct 2017 03:52:02 +0300 Subject: 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 Tested-by: Gaetan Bisson Signed-off-by: Lubomir I. Ivanov --- desktop-widgets/divelistview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'desktop-widgets') 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); -- cgit v1.2.3-70-g09d2