diff options
Diffstat (limited to 'src/gui/image/qpixmap.cpp')
-rw-r--r-- | src/gui/image/qpixmap.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index c025aa9283..2a2bd5d6fa 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -272,7 +272,7 @@ QPixmap::QPixmap(const char * const xpm[]) QPixmap::~QPixmap() { - Q_ASSERT(!data || data->ref >= 1); // Catch if ref-counting changes again + Q_ASSERT(!data || data->ref.load() >= 1); // Catch if ref-counting changes again } /*! @@ -871,7 +871,7 @@ void QPixmap::fill(const QColor &color) return; } - if (data->ref == 1) { + if (data->ref.load() == 1) { // detach() will also remove this pixmap from caches, so // it has to be called even when ref == 1. detach(); @@ -1000,7 +1000,7 @@ QDataStream &operator>>(QDataStream &stream, QPixmap &pixmap) bool QPixmap::isDetached() const { - return data && data->ref == 1; + return data && data->ref.load() == 1; } /*! \internal @@ -1529,10 +1529,10 @@ void QPixmap::detach() rasterData->image.detach(); } - if (data->is_cached && data->ref == 1) + if (data->is_cached && data->ref.load() == 1) QImagePixmapCleanupHooks::executePlatformPixmapModificationHooks(data.data()); - if (data->ref != 1) { + if (data->ref.load() != 1) { *this = copy(); } ++data->detach_no; |