summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/opengl/qgl_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index b5d17e8..5fe6678 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -696,7 +696,8 @@ int QGLTextureCache::maxCost()
QGLTexture* QGLTextureCache::getTexture(QGLContext *ctx, qint64 key)
{
- QReadLocker locker(&m_lock);
+ // 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);
}