Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit cd02553f authored by Boudewijn Rempt's avatar Boudewijn Rempt Committed by Wolthera van Hövell

Make KoStopGradient::colorAt threadsave

Sneakily, the "buffer" variable was made a class variable. Marking
it mutable allows us to change it from a const function, which hides
the fact that this is global data (doubly hidden by there not being
an m_ prefix), which makes the const function thread unsafe.
parent 904cc82d
...@@ -132,6 +132,8 @@ QGradient* KoStopGradient::toQGradient() const ...@@ -132,6 +132,8 @@ QGradient* KoStopGradient::toQGradient() const
void KoStopGradient::colorAt(KoColor& dst, qreal t) const void KoStopGradient::colorAt(KoColor& dst, qreal t) const
{ {
KoColor buffer;
if (! m_stops.count()) if (! m_stops.count())
return; return;
if (t <= m_stops.first().first || m_stops.count() == 1) { if (t <= m_stops.first().first || m_stops.count() == 1) {
...@@ -69,10 +69,6 @@ protected: ...@@ -69,10 +69,6 @@ protected:
QPointF m_stop; QPointF m_stop;
QPointF m_focalPoint; QPointF m_focalPoint;
mutable KoColor buffer;
private: private:
void loadKarbonGradient(QIODevice *file); void loadKarbonGradient(QIODevice *file);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment