summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglgradientcache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/opengl/qopenglgradientcache.cpp')
-rw-r--r--src/gui/opengl/qopenglgradientcache.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglgradientcache.cpp b/src/gui/opengl/qopenglgradientcache.cpp
index 91b4d08474..f8060fc6a0 100644
--- a/src/gui/opengl/qopenglgradientcache.cpp
+++ b/src/gui/opengl/qopenglgradientcache.cpp
@@ -102,13 +102,13 @@ void QOpenGL2GradientCache::cleanCache()
GLuint QOpenGL2GradientCache::getBuffer(const QGradient &gradient, qreal opacity)
{
- QMutexLocker lock(&m_mutex);
quint64 hash_val = 0;
QGradientStops stops = gradient.stops();
for (int i = 0; i < stops.size() && i <= 2; i++)
hash_val += stops[i].second.rgba();
+ const QMutexLocker lock(&m_mutex);
QOpenGLGradientColorTableHash::const_iterator it = cache.constFind(hash_val);
if (it == cache.constEnd())