diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-07-28 21:32:56 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-07-28 21:33:17 +0200 |
commit | 182983943b76bc0e40ff7693853ef2262323fa80 (patch) | |
tree | 4e542c3f2906e348da045375c3a3a85fc1d0d73c /src/qml/qml/qqmlbinding.cpp | |
parent | 8ced0f0f9954f857265fd18080da95427069135d (diff) | |
parent | 80e03bbd9a42401d50af450aff5351c3a0c95444 (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I7d092cce33cb009d63e7b0df7c71183089dea53f
Diffstat (limited to 'src/qml/qml/qqmlbinding.cpp')
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 0ccb4e8e4e..84f30af066 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -559,7 +559,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); |