Skip to content

Commit

Permalink
Avoid random crash in HrPwPlot when HR>=220
Browse files Browse the repository at this point in the history
Fixes #4260
  • Loading branch information
amtriathlon committed Aug 24, 2022
1 parent 0108a05 commit 481e11f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Charts/HrPwPlot.cpp
Expand Up @@ -426,7 +426,7 @@ HrPwPlot::addHrStepCurve(QVector<double> &finalHr, int nbpoints)
QMapIterator<double,double> l(hrHist);
while (l.hasNext()) {
l.next();
array[(int) round(l.key())] += l.value();
if (l.key() >= 0 && l.key() < maxHr) array[(int) round(l.key())] += l.value();
}


Expand All @@ -447,7 +447,6 @@ HrPwPlot::addHrStepCurve(QVector<double> &finalHr, int nbpoints)
}
smoothTimeStep2[t] = 0.0;
smoothHrStep[t] = t * 2;

hrStepCurve->setSamples(smoothTimeStep2.data(), smoothHrStep.data(), nbSteps+1);
delete [] array;
}
Expand Down

0 comments on commit 481e11f

Please sign in to comment.