rebuild-QmlDatapropertyCache-if-deleted
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Wed, 16 Aug 2017 01:09:04 +0000 (02:09 +0100)
committerLisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>
Wed, 16 Aug 2017 01:09:04 +0000 (02:09 +0100)
Gbp-Pq: Name rebuild-QmlDatapropertyCache-if-deleted.patch

src/qml/qml/qqmlbinding.cpp

index 62288a5845d3162438f859b7d1e1cc259ce557f8..325f752cd5fd6621f5b26597ad41454009a28868 100644 (file)
@@ -515,7 +515,12 @@ void QQmlBinding::getPropertyData(QQmlPropertyData **propertyData, QQmlPropertyD
     Q_ASSERT(propertyData);
 
     QQmlData *data = QQmlData::get(*m_target, false);
-    Q_ASSERT(data && data->propertyCache);
+    Q_ASSERT(data);
+
+    if (Q_UNLIKELY(!data->propertyCache)) {
+        data->propertyCache = QQmlEnginePrivate::get(context()->engine)->cache(m_target->metaObject());
+        data->propertyCache->addref();
+    }
 
     *propertyData = data->propertyCache->property(m_targetIndex.coreIndex());
     Q_ASSERT(*propertyData);