aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertycache_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-04-05 18:11:51 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-04-05 22:58:46 +0200
commitdc7e85fe52a98c677b96348807bdc6f5e93d9526 (patch)
tree27d148bbff85aaef2a6dce1720d92369b5cfb205 /src/qml/qml/qqmlpropertycache_p.h
parent5bab4d8adedb2d16651685845bcf2dc4133be9d7 (diff)
QQmlMetaObjectPointer: restrict copy ctor to QQmlPropertyCache
... using friendship. Pick-to: 6.3 Change-Id: I311256d7e8d167120e31142b846615d793e17ce1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlpropertycache_p.h')
-rw-r--r--src/qml/qml/qqmlpropertycache_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h
index e6a08f33c7..8177e72821 100644
--- a/src/qml/qml/qqmlpropertycache_p.h
+++ b/src/qml/qml/qqmlpropertycache_p.h
@@ -69,6 +69,7 @@ class QCryptographicHash;
class QJSEngine;
class QMetaObjectBuilder;
class QQmlContextData;
+class QQmlPropertyCache;
class QQmlPropertyCacheMethodArguments;
class QQmlVMEMetaObject;
@@ -90,6 +91,8 @@ public:
reinterpret_cast<SharedHolder *>(dd ^ Shared)->release();
}
+private:
+ friend class QQmlPropertyCache;
QQmlMetaObjectPointer(const QQmlMetaObjectPointer &other)
: d(other.d.loadRelaxed())
{
@@ -103,6 +106,7 @@ public:
QQmlMetaObjectPointer &operator=(QQmlMetaObjectPointer &&other) = delete;
QQmlMetaObjectPointer &operator=(const QQmlMetaObjectPointer &other) = delete;
+public:
void setSharedOnce(QMetaObject *shared) const
{
SharedHolder *holder = new SharedHolder(shared);