aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcomponent.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-07-25 17:24:11 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-07-27 16:02:26 +0000
commitffdf0ed0f85207751eb2f90970dd63eb1b1c58a4 (patch)
treebdaf7a44020c62b87c4d2c9ab9f72f9df3da2db7 /src/qml/qml/qqmlcomponent.cpp
parent3934ae38cd22f202508555014bca015ea8c7bf2e (diff)
Don't needlessly look up debug services
Change-Id: Idcca82b85e07ca0a8a9a2f370af90403bc4342c7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlcomponent.cpp')
-rw-r--r--src/qml/qml/qqmlcomponent.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 854090f20b..175b84e7c5 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -874,11 +874,13 @@ QQmlComponentPrivate::beginCreate(QQmlContextData *context)
depthIncreased = false;
}
- QQmlEngineDebugService *service = QQmlDebugConnector::service<QQmlEngineDebugService>();
- if (service && rv) {
- if (!context->isInternal)
- context->asQQmlContextPrivate()->instances.append(rv);
- service->objectCreated(engine, rv);
+ if (rv) {
+ if (QQmlEngineDebugService *service =
+ QQmlDebugConnector::service<QQmlEngineDebugService>()) {
+ if (!context->isInternal)
+ context->asQQmlContextPrivate()->instances.append(rv);
+ service->objectCreated(engine, rv);
+ }
}
return rv;