QmlDesigner: Fix crash on puppet

Change-Id: I233d3dab5a509bfd7c9a30c7dcc15dcf8751f456
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2020-06-16 17:05:56 +02:00
committed by Tim Jenssen
parent 72302cac49
commit 003282c6f5

View File

@@ -779,7 +779,9 @@ QObject *ObjectNodeInstance::createComponent(const QUrl &componentUrl, QQmlConte
return QmlPrivateGate::createComponent(componentUrl, context);
}
QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource, const QByteArray &importCode, QQmlContext *context)
QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource,
const QByteArray &importCode,
QQmlContext *context)
{
QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete;
Q_UNUSED(disableComponentComplete)
@@ -790,9 +792,11 @@ QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource,
data.prepend(importCode);
component.setData(data, context->baseUrl().resolved(QUrl("createCustomParserObject.qml")));
QObject *object = component.beginCreate(context);
QmlPrivateGate::tweakObjects(object);
component.completeCreate();
QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership);
if (object) {
QmlPrivateGate::tweakObjects(object);
component.completeCreate();
QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership);
}
if (component.isError()) {
qWarning() << "Error in:" << Q_FUNC_INFO << component.url().toString();