aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4qmlcontext.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-11-05 15:00:24 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-11-09 00:03:09 +0100
commit5fee28537b5f2ed6f1ca1558545597b66ec22270 (patch)
treefe3580bd5ca31c45d4ffc927bcb50b165d706d48 /src/qml/jsruntime/qv4qmlcontext.cpp
parent13a0da5bd2cf59aeb343fe9345b9bac2cfbb5e6f (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/jsruntime/qv4qmlcontext.cpp')
-rw-r--r--src/qml/jsruntime/qv4qmlcontext.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp
index 90ff3a0ea0..c3fbff7f55 100644
--- a/src/qml/jsruntime/qv4qmlcontext.cpp
+++ b/src/qml/jsruntime/qv4qmlcontext.cpp
@@ -311,7 +311,7 @@ ReturnedValue QQmlContextWrapper::getPropertyAndBase(const QQmlContextWrapper *r
ScopedValue val(scope, base ? *base : Value::fromReturnedValue(QV4::QObjectWrapper::wrap(v4, scopeObject)));
const QObjectWrapper *That = static_cast<const QObjectWrapper *>(val->objectValue());
lookup->qobjectLookup.ic = That->internalClass();
- lookup->qobjectLookup.propertyCache = ddata->propertyCache;
+ lookup->qobjectLookup.propertyCache = ddata->propertyCache.data();
lookup->qobjectLookup.propertyCache->addref();
lookup->qobjectLookup.propertyData = propertyData;
lookup->qmlContextPropertyGetter = QQmlContextWrapper::lookupScopeObjectProperty;
@@ -345,7 +345,7 @@ ReturnedValue QQmlContextWrapper::getPropertyAndBase(const QQmlContextWrapper *r
: Value::fromReturnedValue(QV4::QObjectWrapper::wrap(v4, contextObject)));
const QObjectWrapper *That = static_cast<const QObjectWrapper *>(val->objectValue());
lookup->qobjectLookup.ic = That->internalClass();
- lookup->qobjectLookup.propertyCache = ddata->propertyCache;
+ lookup->qobjectLookup.propertyCache = ddata->propertyCache.data();
lookup->qobjectLookup.propertyCache->addref();
lookup->qobjectLookup.propertyData = propertyData;
lookup->qmlContextPropertyGetter = contextGetterFunction;