diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2024-02-28 16:02:18 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-03-18 16:59:21 +0100 |
| commit | 34e3a1d71cda07978590971af4f0d043498ae0cc (patch) | |
| tree | 65dd9de0623c4f1486941b383e52f55da7fd4fb9 /src/quicktemplates/qquickdeferredexecute.cpp | |
| parent | 1ca0cf55f9d26650f0e5fb58c3837ad5288a7268 (diff) | |
QtQml: Assert on ddata and ddata->propertyCache in doPopulateDeferred()
The caller has to guarantee that the ddata and property cache ar alive
at that point. Therefore, make sure that qmlExecuteDeferred() and
QtQuickPrivate::beginDeferred() actually guarantee as much.
Coverity-Id: 437884
Change-Id: I89bfa5ca47347416d0acd023d073d524363a0635
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/quicktemplates/qquickdeferredexecute.cpp')
| -rw-r--r-- | src/quicktemplates/qquickdeferredexecute.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quicktemplates/qquickdeferredexecute.cpp b/src/quicktemplates/qquickdeferredexecute.cpp index 239b0fa6a6..19870a5636 100644 --- a/src/quicktemplates/qquickdeferredexecute.cpp +++ b/src/quicktemplates/qquickdeferredexecute.cpp @@ -30,6 +30,9 @@ static bool beginDeferred(QQmlEnginePrivate *enginePriv, const QQmlProperty &pro QQmlData *ddata = QQmlData::get(object); Q_ASSERT(!ddata->deferredData.isEmpty()); + if (!ddata->propertyCache) + ddata->propertyCache = QQmlMetaType::propertyCache(object->metaObject()); + int propertyIndex = property.index(); int wasInProgress = enginePriv->inProgressCreations; |
