diff options
-rw-r--r-- | src/qml/qml/qqmlpropertycache_p.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index 7f3fc5f4fc..e6a08f33c7 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -85,8 +85,9 @@ public: ~QQmlMetaObjectPointer() { - if (d & Shared) - reinterpret_cast<SharedHolder *>(d ^ Shared)->release(); + const auto dd = d.loadAcquire(); + if (dd & Shared) + reinterpret_cast<SharedHolder *>(dd ^ Shared)->release(); } QQmlMetaObjectPointer(const QQmlMetaObjectPointer &other) @@ -111,9 +112,10 @@ public: const QMetaObject *metaObject() const { - if (d & Shared) - return reinterpret_cast<SharedHolder *>(d ^ Shared)->metaObject; - return reinterpret_cast<const QMetaObject *>(d.loadRelaxed()); + const auto dd = d.loadAcquire(); + if (dd & Shared) + return reinterpret_cast<SharedHolder *>(dd ^ Shared)->metaObject; + return reinterpret_cast<const QMetaObject *>(dd); } bool isShared() const |