diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-08-16 20:37:22 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-08-16 20:37:22 +0300 |
commit | f274d775774b78f6217c9770ae87045d969acbe1 (patch) | |
tree | d14162d5a1badabc71f6034bd4013b521d8f52e9 /src/qml/qml/qqmlpropertycache_p.h | |
parent | ae66ecf0f95c79d730190b92e641c0410d5d6896 (diff) | |
parent | eaf011c4ae440bbf7a02ceb7a33be5dfa5bcf907 (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.6' into tqtc/lts-5.15-opensourcev5.15.6-lts-lgpl
Change-Id: Ic3ca76460360cbab866a4e881c4848e6deeaf7d7
Diffstat (limited to 'src/qml/qml/qqmlpropertycache_p.h')
-rw-r--r-- | src/qml/qml/qqmlpropertycache_p.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index a5340cec37..1563bc0a41 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -220,6 +220,8 @@ private: _hasPropertyOverrides |= isOverride; } + int findPropType(const QQmlPropertyData *data) const; + private: QQmlPropertyCache *_parent; int propertyIndexCacheStart; @@ -239,14 +241,18 @@ private: QByteArray _dynamicClassName; QByteArray _dynamicStringData; QString _defaultPropertyName; - QQmlPropertyCacheMethodArguments *argumentsCache; + QAtomicPointer<QQmlPropertyCacheMethodArguments> argumentsCache; int _jsFactoryMethodIndex; QByteArray _checksum; }; inline QQmlPropertyData *QQmlPropertyCache::ensureResolved(QQmlPropertyData *p) const { - if (p && Q_UNLIKELY(p->notFullyResolved())) + // Avoid resolve() in the common case where it's already initialized and we don't + // run into a data race. resolve() checks again, with an atomic operation. + // If there is no coreIndex, there is no point in trying to resolve anything. In that + // case it's a default-constructed instance that never got load()'ed or lazyLoad()'ed. + if (p && p->coreIndex() != -1 && Q_UNLIKELY(p->m_propTypeAndRelativePropIndex == 0)) resolve(p); return p; |