From a483852c5c56c0ceb14369909433f11ad1132f40 2015-10-01 07:51:30 From: Miikka Heikkinen Date: 2015-10-01 07:51:30 Subject: [PATCH] Fix crash in axis grid animation when animating axis is removed from chart. Change-Id: Ibd39910f3463e0ccdb62799dfc533018a932f542 Reviewed-by: Titta Heikkala --- diff --git a/src/charts/chartpresenter.cpp b/src/charts/chartpresenter.cpp index 2bac63c..e2c0f79 100644 --- a/src/charts/chartpresenter.cpp +++ b/src/charts/chartpresenter.cpp @@ -101,7 +101,9 @@ void ChartPresenter::handleAxisAdded(QAbstractAxis *axis) void ChartPresenter::handleAxisRemoved(QAbstractAxis *axis) { - ChartAxisElement *item = axis->d_ptr->m_item.take(); + ChartAxisElement *item = axis->d_ptr->m_item.take(); + if (item->animation()) + item->animation()->stopAndDestroyLater(); item->hide(); item->disconnect(); item->deleteLater();