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 <samuel.ghinet@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Miikka Heikkinen
2021-11-30 14:57:18 +02:00
parent eadc9cb0e3
commit 26ba5bdb0c

View File

@@ -61,6 +61,10 @@
#include <private/qqmlmetatype_p.h>
#include <private/qqmltimer_p.h>
#ifdef QUICK3D_MODULE
#include <private/qquick3dobject_p.h>
#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<QQuick3DObject *>(object);
if (obj3d && QQuick3DObjectPrivate::get(obj3d)->componentComplete)
return;
#endif
if (!nodeInstanceServer->hasInstanceForObject(item))
emitComponentComplete(object);