summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-10-26 13:46:11 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-10-27 10:14:05 (GMT)
commita87dbf0d08d58b829ca2fa036d589ad4fd48949f (patch)
tree2bfb93c21d1ffa1a0c083d1a7b104e88a4de6956 /src/gui
parente5ef6f580e1b601898a2fea095ed5be9823bab25 (diff)
downloadQt-a87dbf0d08d58b829ca2fa036d589ad4fd48949f.zip
Qt-a87dbf0d08d58b829ca2fa036d589ad4fd48949f.tar.gz
Qt-a87dbf0d08d58b829ca2fa036d589ad4fd48949f.tar.bz2
Fixed race condition in raster paint engine.
We need to protect the gradient cache accesses with a mutex. Task-number: QTBUG-14614 Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 975ebb0..c03f82b 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -4811,6 +4811,7 @@ public:
for (int i = 0; i < stops.size() && i <= 2; i++)
hash_val += stops[i].second.rgba();
+ QMutexLocker lock(&mutex);
QGradientColorTableHash::const_iterator it = cache.constFind(hash_val);
if (it == cache.constEnd())
@@ -4844,6 +4845,7 @@ protected:
}
QGradientColorTableHash cache;
+ QMutex mutex;
};
void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint *colorTable, int size, int opacity) const