[new compiler] Fix tst_qqmlqt::createComponent
authorSimon Hausmann <simon.hausmann@digia.com>
Thu, 27 Feb 2014 07:41:26 +0000 (08:41 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sun, 2 Mar 2014 16:11:12 +0000 (17:11 +0100)
Initialize the binding's self-pointer before calling addObject(), as some funky tests
try to delete the binding from within there and the self-pointer allows us to find out
later that the binding was deleted.

Change-Id: I8c9e3fe7304f304eace29c0631263b1ec021a8c4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/qqmlobjectcreator.cpp

index 58ed18b..5368977 100644 (file)
@@ -770,6 +770,9 @@ bool QQmlObjectCreator::setPropertyBinding(QQmlPropertyData *property, const QV4
             if (_valueTypeProperty)
                 targetCorePropertyData = QQmlPropertyPrivate::saveValueType(*_valueTypeProperty, _qobject->metaObject(), property->coreIndex, engine);
 
+            sharedState->allCreatedBindings.push(qmlBinding);
+            qmlBinding->m_mePtr = &sharedState->allCreatedBindings.top();
+
             qmlBinding->setTarget(_bindingTarget, targetCorePropertyData, context);
 
             if (targetCorePropertyData.isAlias()) {
@@ -788,9 +791,6 @@ bool QQmlObjectCreator::setPropertyBinding(QQmlPropertyData *property, const QV4
                     targetDeclarativeData->setPendingBindingBit(_bindingTarget, property->coreIndex);
                 }
             }
-
-            sharedState->allCreatedBindings.push(qmlBinding);
-            qmlBinding->m_mePtr = &sharedState->allCreatedBindings.top();
         }
         return true;
     }