Commented confusing QWriteLocker use in QGLTextureCache::getTexture().
authorSamuel Rødal <samuel.rodal@digia.com>
Tue, 27 Nov 2012 09:25:34 +0000 (10:25 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 27 Nov 2012 18:31:21 +0000 (19:31 +0100)
Task-number: QTBUG-22560
Change-Id: Idd3948455e8415473a407f66b628418c0d87898d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
src/opengl/qgl_p.h

index 7154545..df099ea 100644 (file)
@@ -504,6 +504,7 @@ int QGLTextureCache::maxCost()
 
 QGLTexture* QGLTextureCache::getTexture(QGLContext *ctx, qint64 key)
 {
+    // Can't be a QReadLocker since QCache::object() modifies the cache (reprioritizes the object)
     QWriteLocker locker(&m_lock);
     const QGLTextureCacheKey cacheKey = {key, QGLContextPrivate::contextGroup(ctx)};
     return m_cache.object(cacheKey);