diff options
author | Tarja Sundqvist <[email protected]> | 2025-06-03 13:43:35 +0300 |
---|---|---|
committer | Tarja Sundqvist <[email protected]> | 2025-06-03 13:43:35 +0300 |
commit | 0f0972d542d9869c2dcfaf9c963d42ff32766460 (patch) | |
tree | f283360ffbf0453e04a321e01f0c3df1c07df3e3 /src/quick/util/qquickprofiler_p.h | |
parent | 07e23b0f4983631524716f034c0268fd11d037f9 (diff) | |
parent | ff0a47c8f267e905113b82c53af2742027f0eca6 (diff) |
Merge tag 'v6.5.6-lts-lgpl' into 6.56.5
Qt 6.5.6-lts-lgpl release
Diffstat (limited to 'src/quick/util/qquickprofiler_p.h')
-rw-r--r-- | src/quick/util/qquickprofiler_p.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/quick/util/qquickprofiler_p.h b/src/quick/util/qquickprofiler_p.h index 276172a2da..7768351b70 100644 --- a/src/quick/util/qquickprofiler_p.h +++ b/src/quick/util/qquickprofiler_p.h @@ -316,7 +316,17 @@ protected: void processMessage(const QQuickProfilerData &message) { QMutexLocker lock(&m_dataMutex); - m_data.append(message); + if (Q_LIKELY(m_data.isEmpty() || m_data.last().time <= message.time)) { + m_data.append(message); + return; + } + + // Since the scenegraph data is recorded from different threads, contention for the lock + // can cause it to be processed out of order here. Insert the message at the right place. + const auto it = std::find_if( + m_data.rbegin(), m_data.rend(), + [t = message.time](const QQuickProfilerData &i) { return i.time <= t; }); + m_data.insert(it.base(), message); } void startProfilingImpl(quint64 features); |