From c3a973273e3c7ac61b8dd9aec282847d30fd4ac1 Mon Sep 17 00:00:00 2001 From: Mika Salmela Date: Sat, 2 Dec 2017 22:30:30 +0200 Subject: If not m_resetArray then create it Fix m_resetArray so that if it not yet created, then create it. Currently it is created every time. Change-Id: I850bd9d2f719cd76bfd3292a439f9585a4e99fc3 Reviewed-by: Miikka Heikkinen --- examples/datavisualization/qmloscilloscope/datasource.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/datavisualization') diff --git a/examples/datavisualization/qmloscilloscope/datasource.cpp b/examples/datavisualization/qmloscilloscope/datasource.cpp index 4a9aaddb..58e72d99 100644 --- a/examples/datavisualization/qmloscilloscope/datasource.cpp +++ b/examples/datavisualization/qmloscilloscope/datasource.cpp @@ -39,7 +39,7 @@ Q_DECLARE_METATYPE(QSurface3DSeries *) DataSource::DataSource(QObject *parent) : QObject(parent), m_index(-1), - m_resetArray(0) + m_resetArray(nullptr) { //! [4] qRegisterMetaType(); @@ -125,7 +125,7 @@ void DataSource::update(QSurface3DSeries *series) // If the first time or the dimensions of the cache array have changed, // reconstruct the reset array - if (m_resetArray || series->dataProxy()->rowCount() != newRowCount + if (!m_resetArray || series->dataProxy()->rowCount() != newRowCount || series->dataProxy()->columnCount() != newColumnCount) { m_resetArray = new QSurfaceDataArray(); m_resetArray->reserve(newRowCount); -- cgit v1.2.3