From 53a8167787acf4618317c926c8d3bbd2dfb25e9e Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Sat, 9 Apr 2011 08:20:06 +0100 Subject: [PATCH] Fix Weekly Summary Crash Refactoring of WeeklySummary to use the metricDB (speed optimisation) introduced a bug where the ridefile iterator was erroneously used whilst computing daily averages. This patch fixes this by using the daily iterator instead. Many thanks to John Ehrlinger for identifying, reporting and helping to diagnose this defect. --- src/WeeklySummaryWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WeeklySummaryWindow.cpp b/src/WeeklySummaryWindow.cpp index 87e4fc7fe..f77e96e2d 100644 --- a/src/WeeklySummaryWindow.cpp +++ b/src/WeeklySummaryWindow.cpp @@ -216,7 +216,7 @@ WeeklySummaryWindow::refresh() // average RI for the day if (dailyRides[day] > 1) - dailyRI[day] = ((dailyRI[day] * (dailyRides[i]-1)) + dailyRI[day] = ((dailyRI[day] * (dailyRides[day]-1)) + metrics.getForSymbol("skiba_relative_intensity")) / dailyRides[day]; else dailyRI[day] = metrics.getForSymbol("skiba_relative_intensity");