From 26ba5bdb0cbe69c2b51f2e00dd70f56932feffb3 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 30 Nov 2021 14:57:18 +0200 Subject: [PATCH] QmlDesigner: Fix puppet crash with nested Repeater3Ds Repeater3D instance instantiated by another Repeater3D got its componentCompleted called twice because a repeater constructing a child repeater already completes the component as part of the process, and then we recursively complete the children again when completing the parent. Added a check to avoid duplicate completions. Fixes: QDS-5651 Change-Id: Iefc7deff4877df903f784396f2efd13468f604b7 Reviewed-by: Samuel Ghinet Reviewed-by: Qt CI Bot Reviewed-by: Thomas Hartmann --- .../qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp index 195fd805f47..03b28bbf658 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp +++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp @@ -61,6 +61,10 @@ #include #include +#ifdef QUICK3D_MODULE +#include +#endif + namespace QmlDesigner { namespace Internal { @@ -374,6 +378,11 @@ void doComponentCompleteRecursive(QObject *object, NodeInstanceServer *nodeInsta if (item && DesignerSupport::isComponentComplete(item)) return; +#ifdef QUICK3D_MODULE + auto obj3d = qobject_cast(object); + if (obj3d && QQuick3DObjectPrivate::get(obj3d)->componentComplete) + return; +#endif if (!nodeInstanceServer->hasInstanceForObject(item)) emitComponentComplete(object);