Fixed crash in tst_qglthreads.
QGLTextureCache has a read write locker to protect texture lookups. However, even calling QCache::object() might modify the cache, causing race conditions, since it modifies the priority order of the objects in the cache. Therefore, we need to protect it with a QWriteLocker instead of a QReadLocker. Task-number: QTBUG-22560 Change-Id: I46fffc624ace27e25fb100f865e1df0a19b9093d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
parent
8534bb3dd6
commit
6633dbbac4
@ -504,7 +504,7 @@ int QGLTextureCache::maxCost()
|
||||
|
||||
QGLTexture* QGLTextureCache::getTexture(QGLContext *ctx, qint64 key)
|
||||
{
|
||||
QReadLocker locker(&m_lock);
|
||||
QWriteLocker locker(&m_lock);
|
||||
const QGLTextureCacheKey cacheKey = {key, QGLContextPrivate::contextGroup(ctx)};
|
||||
return m_cache.object(cacheKey);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user