summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qopenglcontext.cpp
diff options
context:
space:
mode:
authorVolker Krause <volker.krause@kdab.com>2016-01-05 15:17:11 +0100
committerVolker Krause <volker.krause@kdab.com>2016-01-06 09:43:19 +0000
commitb1dcdc406446a5e1eb5a7e04d984fed91ceb52ec (patch)
treee6478e4ecf33bc6ae223814f572a36013388ef39 /src/gui/kernel/qopenglcontext.cpp
parentdaeed4631ab61b68609c009a0628f54a2e6e5e11 (diff)
Avoid unnecessary detaching of the pending deletions list.
This code seems to be hit three times per frame in a hybrid QQ2/Qt3D app, quickly generating thousands of allocations here via the detach in begin(). Heaptrack confirms they are all gone now. Change-Id: I7d09f3f5c2b24a2590b701216715055751306e82 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/gui/kernel/qopenglcontext.cpp')
-rw-r--r--src/gui/kernel/qopenglcontext.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 85d05959de..3c033ea39e 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -1459,11 +1459,11 @@ void QOpenGLContextGroupPrivate::deletePendingResources(QOpenGLContext *ctx)
{
QMutexLocker locker(&m_mutex);
- QList<QOpenGLSharedResource *> pending = m_pendingDeletion;
+ const QList<QOpenGLSharedResource *> pending = m_pendingDeletion;
m_pendingDeletion.clear();
- QList<QOpenGLSharedResource *>::iterator it = pending.begin();
- QList<QOpenGLSharedResource *>::iterator end = pending.end();
+ QList<QOpenGLSharedResource *>::const_iterator it = pending.begin();
+ QList<QOpenGLSharedResource *>::const_iterator end = pending.end();
while (it != end) {
(*it)->freeResource(ctx);
delete *it;