aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertycache_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-04-05 12:30:36 +0200
committerThiago Macieira <thiago.macieira@intel.com>2022-04-05 20:59:27 +0000
commit209722dfd81de2a8ec540fd276c3054dede5efc8 (patch)
tree23d5c690159fd88c81f3275cfd438d27666fa662 /src/qml/qml/qqmlpropertycache_p.h
parentdc7e85fe52a98c677b96348807bdc6f5e93d9526 (diff)
QQmlMetaObjectPointer: fix missing release memory fence in setSharedOnce()
We have new'ed up a SharedHolder object whose address we then implant into the atomic variable. This operation requires release semantics, to prevent writes to the object being re-ordered to after the write to the atomic. QQmlMetaObjectPointer did not exist in 6.2, so only Pick-to: 6.3 Change-Id: I04fac8ec6ede0bc02ce44de7334b06f84342da44 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/qml/qml/qqmlpropertycache_p.h')
-rw-r--r--src/qml/qml/qqmlpropertycache_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h
index 8177e72821..831da02431 100644
--- a/src/qml/qml/qqmlpropertycache_p.h
+++ b/src/qml/qml/qqmlpropertycache_p.h
@@ -110,7 +110,7 @@ public:
void setSharedOnce(QMetaObject *shared) const
{
SharedHolder *holder = new SharedHolder(shared);
- if (!d.testAndSetRelaxed(0, quintptr(holder) | Shared))
+ if (!d.testAndSetRelease(0, quintptr(holder) | Shared))
holder->release();
}