if (p->activeVME) { // XXX should only be allowed during begin
a->add(&p->activeVME->componentAttached);
} else if (p->activeObjectCreator) {
- a->add(&p->activeObjectCreator->componentAttached);
+ a->add(p->activeObjectCreator->componentAttached);
} else {
QQmlData *d = QQmlData::get(obj);
Q_ASSERT(d);
if (!compiledData->isInitialized())
compiledData->initialize(engine);
+ componentAttachedImpl = 0;
+ componentAttached = &componentAttachedImpl;
+
if (inheritedBindingStack) {
Q_ASSERT(rootContext);
Q_ASSERT(inheritedParserStatusStack);
return 0;
}
QmlObjectCreator subCreator(context, typeRef->component, creationContext, rootContext, allCreatedBindings, allParserStatusCallbacks);
+ subCreator.componentAttached = componentAttached;
instance = subCreator.create();
if (!instance) {
errors += subCreator.errors;
return 0;
}
- if (subCreator.componentAttached)
- subCreator.componentAttached->add(&componentAttached);
}
// ### use no-event variant
if (parent)
{
QQmlTrace trace("VME Component.onCompleted Callbacks");
- while (componentAttached) {
- QQmlComponentAttached *a = componentAttached;
+ while (componentAttachedImpl) {
+ QQmlComponentAttached *a = componentAttachedImpl;
a->rem();
QQmlData *d = QQmlData::get(a->parent());
Q_ASSERT(d);
QObject *create(int subComponentIndex = -1, QObject *parent = 0);
QQmlContextData *finalize(QQmlInstantiationInterrupt &interrupt);
- QQmlComponentAttached *componentAttached;
+ QQmlComponentAttached **componentAttached;
QList<QQmlEnginePrivate::FinalizeCallback> finalizeCallbacks;
QList<QQmlError> errors;
bool ownBindingAndParserStatusStacks;
QQmlCompiledData *compiledData;
QQmlContextData *rootContext;
+ QQmlComponentAttached *componentAttachedImpl;
QObject *_qobject;
QObject *_scopeObject;