Permalink
Browse files

Fix SEGV in Qt Charts when setData called quickly

.. if you scroll up and down the ride list whilst the
   overview is open Qt Charts will crash trying to
   complete an animation.

.. to fix this we disable animations before trying
   to update the chart (including setting animation
   options back on)
  • Loading branch information...
1 parent eadb921 commit 9c8a41d2c64b25d77fc748378f5db20413316c50 @liversedge liversedge committed Feb 16, 2017
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/Charts/OverviewWindow.cpp
@@ -427,6 +427,11 @@ static const QStringList timeInZonesWBAL = QStringList()
void
Card::setData(RideItem *item)
{
+
+ // stop any animation before starting, just in case- stops a crash
+ // when we update a chart in the middle of its animation
+ if (chart) chart->setAnimationOptions(QChart::NoAnimation);
+
if (type == METRIC) {
// get last 30 days, if they exist

0 comments on commit 9c8a41d

Please sign in to comment.