aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-06-23 13:20:23 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-08-02 16:32:43 +0000
commit49a11e882059ee1729f776722e085dd21d378c36 (patch)
tree1b0fe9a471766d97d03602502acc57c00df93b36 /src/plugins
parent97165444ac6954766d53c3eb62eb1614644c7264 (diff)
Use QQmlType by value
QQmlType is now refcounted, and we need to use it by value, to control it's lifetime properly. This is required, so we can clean up the QQmlMetaTypeData cache on engine destruction and with trimComponentCache() Task-number: QTBUG-61536 Change-Id: If86391c86ea20a646ded7c9925d8f743f628fb91 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
index f0bb4de016..3d08c4c809 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
@@ -695,8 +695,9 @@ bool QQmlEngineDebugServiceImpl::resetBinding(int objectId, const QString &prope
property.reset();
} else {
// overwrite with default value
- if (QQmlType *objType = QQmlMetaType::qmlType(object->metaObject())) {
- if (QObject *emptyObject = objType->create()) {
+ QQmlType objType = QQmlMetaType::qmlType(object->metaObject());
+ if (objType.isValid()) {
+ if (QObject *emptyObject = objType.create()) {
if (emptyObject->property(parentProperty).isValid()) {
QVariant defaultValue = QQmlProperty(emptyObject, propertyName).read();
if (defaultValue.isValid()) {