From d3c04e27fa0549b61516fb49c010a30b8d9a6eed Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Fri, 8 May 2020 20:05:31 +0100 Subject: [PATCH] Fix metric refresh SEGV .. last commit didn't avoid the detach() derefernce in a thread because it used the [] operator which is non-const, instead we should use QVector::at(int) --- src/Core/RideCacheModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/RideCacheModel.cpp b/src/Core/RideCacheModel.cpp index 57adf586c..238521ced 100644 --- a/src/Core/RideCacheModel.cpp +++ b/src/Core/RideCacheModel.cpp @@ -67,7 +67,7 @@ RideCacheModel::data(const QModelIndex &index, int role) const if (!index.isValid() || index.row() < 0 || index.row() >= rideCache->count() || index.column() < 0 || index.column() >= columns_) return QVariant(); - const RideItem *item = rideCache->rides()[index.row()]; + const RideItem *item = rideCache->rides().at(index.row()); switch (index.column()) { case 0 : return item->path;