diff options
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpainterpath.h | 3 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath_p.h | 4 | ||||
-rw-r--r-- | src/gui/painting/qpen.cpp | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index 9dc435f630..a558abca3d 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -249,6 +249,9 @@ public: friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPainterPath &); friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &); #endif + + QPainterPathPrivate() : ref(1) {} + private: QAtomicInt ref; QVector<QPainterPath::Element> elements; diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h index 93cc11c8ee..8d5bd7310f 100644 --- a/src/gui/painting/qpainterpath_p.h +++ b/src/gui/painting/qpainterpath_p.h @@ -148,13 +148,12 @@ public: dirtyControlBounds(false), pathConverter(0) { - ref = 1; require_moveTo = false; convex = false; } QPainterPathData(const QPainterPathData &other) : - QPainterPathPrivate(), cStart(other.cStart), fillRule(other.fillRule), + cStart(other.cStart), fillRule(other.fillRule), bounds(other.bounds), controlBounds(other.controlBounds), dirtyBounds(other.dirtyBounds), @@ -162,7 +161,6 @@ public: convex(other.convex), pathConverter(0) { - ref = 1; require_moveTo = false; elements = other.elements; } diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp index 5a4582e31e..5358239014 100644 --- a/src/gui/painting/qpen.cpp +++ b/src/gui/painting/qpen.cpp @@ -358,7 +358,7 @@ void QPen::detach() QPenData *x = new QPenData(*static_cast<QPenData *>(d)); if (!d->ref.deref()) delete d; - x->ref = 1; + x->ref.store(1); d = x; } |