aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2016-02-18 11:39:07 +0100
committerUlf Hermann <ulf.hermann@theqtcompany.com>2016-03-02 09:32:38 +0000
commitdf16c819cb4ee096a38c8c013cbb26a0ca561432 (patch)
tree1f3798ae592c592ce1f23e97cbb550f5a6ca7d53
parentb2ea9e760e867a8d5c7eb2bc6f4ad214bf23d9d4 (diff)
Clear profiling data from QQuickProfiler after reporting
This is what 5.6 does. It's debatable if this is actually correct, as logically we should report the same global profiling data multiple times, when data for different engines is reported. However, there is no practical benefit for such a "feature". It just wastes CPU time and memory and it makes the client implementation more complicated. Change-Id: I6d2a253d906d3d74c9d9b1f8fc952673c9da3e2a Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
-rw-r--r--src/quick/util/qquickprofiler.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/quick/util/qquickprofiler.cpp b/src/quick/util/qquickprofiler.cpp
index dc72b5f287..f8d090cc2c 100644
--- a/src/quick/util/qquickprofiler.cpp
+++ b/src/quick/util/qquickprofiler.cpp
@@ -99,22 +99,22 @@ QQuickProfiler::~QQuickProfiler()
void QQuickProfiler::startProfilingImpl(quint64 features)
{
QMutexLocker lock(&m_dataMutex);
- m_data.clear();
featuresEnabled = features;
}
void QQuickProfiler::stopProfilingImpl()
{
- {
- QMutexLocker lock(&m_dataMutex);
- featuresEnabled = 0;
- }
+ QMutexLocker lock(&m_dataMutex);
+ featuresEnabled = 0;
emit dataReady(m_data);
+ m_data.clear();
}
void QQuickProfiler::reportDataImpl()
{
+ QMutexLocker lock(&m_dataMutex);
emit dataReady(m_data);
+ m_data.clear();
}
void QQuickProfiler::setTimer(const QElapsedTimer &t)