summaryrefslogtreecommitdiffstats
path: root/tests/scattertest/scatterchart.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-06-03 14:15:50 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2014-06-04 08:26:32 +0300
commitb49bd4aea2265de243e41c19ffa44f04759bcf8d (patch)
tree1af3a1414782073a97d909c2fae73b92c7d1f51d /tests/scattertest/scatterchart.cpp
parent779da0484f409ac93d32e3fdd5af7a30a52883a6 (diff)
Misc fixes found during testing
- Memory leaks - Y-axis placement issues in scatter and surface Change-Id: I7ec6c9c3e53502445b52c049c973186a7c54c95f Reviewed-by: Titta Heikkala <titta.heikkala@digia.com> Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'tests/scattertest/scatterchart.cpp')
-rw-r--r--tests/scattertest/scatterchart.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/scattertest/scatterchart.cpp b/tests/scattertest/scatterchart.cpp
index dce73e61..e498b2da 100644
--- a/tests/scattertest/scatterchart.cpp
+++ b/tests/scattertest/scatterchart.cpp
@@ -250,7 +250,7 @@ void ScatterDataModifier::testItemChanges()
foreach (QScatter3DSeries *series, m_chart->seriesList())
m_chart->removeSeries(series);
foreach (QValue3DAxis *axis, m_chart->axes())
- m_chart->releaseAxis(axis);
+ deleteAxis(axis);
delete series0;
delete series1;
delete series2;
@@ -425,7 +425,7 @@ void ScatterDataModifier::testAxisReverse()
foreach (QScatter3DSeries *series, m_chart->seriesList())
m_chart->removeSeries(series);
foreach (QValue3DAxis *axis, m_chart->axes())
- m_chart->releaseAxis(axis);
+ deleteAxis(axis);
delete series0;
delete series1;
series0 = new QScatter3DSeries;
@@ -627,11 +627,17 @@ void ScatterDataModifier::clear()
qDebug() << m_loopCounter << "Cleared array";
}
+void ScatterDataModifier::deleteAxis(QValue3DAxis *axis)
+{
+ m_chart->releaseAxis(axis);
+ delete axis;
+}
+
void ScatterDataModifier::resetAxes()
{
- m_chart->releaseAxis(m_chart->axisX());
- m_chart->releaseAxis(m_chart->axisY());
- m_chart->releaseAxis(m_chart->axisZ());
+ deleteAxis(m_chart->axisX());
+ deleteAxis(m_chart->axisY());
+ deleteAxis(m_chart->axisZ());
m_chart->setAxisX(new QValue3DAxis);
m_chart->setAxisY(new QValue3DAxis);