diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-11-05 15:00:24 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-11-09 00:03:09 +0100 |
commit | 5fee28537b5f2ed6f1ca1558545597b66ec22270 (patch) | |
tree | fe3580bd5ca31c45d4ffc927bcb50b165d706d48 /src/qml/qml/qqmlmetaobject_p.h | |
parent | 13a0da5bd2cf59aeb343fe9345b9bac2cfbb5e6f (diff) |
Clean up PropertyCache life cycle
We generally want to use QQmlRefPointer for it, rather than manually
calling addref() and release() all over the place. Also, we can
completely inline its ctor and drop an unused member.
Also, do not keep property caches of dynamic meta objects in type
registry. The dynamic metaobjects will change, and the outdated
property caches will eventually be retrieved.
Change-Id: I8042c85b32f3031b554f97a35c1545a3412d2acb
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlmetaobject_p.h')
-rw-r--r-- | src/qml/qml/qqmlmetaobject_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlmetaobject_p.h b/src/qml/qml/qqmlmetaobject_p.h index be57ff3999..2998e2542f 100644 --- a/src/qml/qml/qqmlmetaobject_p.h +++ b/src/qml/qml/qqmlmetaobject_p.h @@ -75,7 +75,7 @@ public: inline QQmlMetaObject() = default; inline QQmlMetaObject(const QObject *); inline QQmlMetaObject(const QMetaObject *); - inline QQmlMetaObject(QQmlPropertyCache *); + inline QQmlMetaObject(const QQmlRefPointer<QQmlPropertyCache> &); inline QQmlMetaObject(const QQmlMetaObject &); inline QQmlMetaObject &operator=(const QQmlMetaObject &); @@ -127,7 +127,7 @@ QQmlMetaObject::QQmlMetaObject(const QMetaObject *m) { } -QQmlMetaObject::QQmlMetaObject(QQmlPropertyCache *m) +QQmlMetaObject::QQmlMetaObject(const QQmlRefPointer<QQmlPropertyCache> &m) { if (m) _m = m->createMetaObject(); |