diff options
Diffstat (limited to 'src/qml/qml/qqmlvme.cpp')
-rw-r--r-- | src/qml/qml/qqmlvme.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp index 4abc6f46fa..8198eeca66 100644 --- a/src/qml/qml/qqmlvme.cpp +++ b/src/qml/qml/qqmlvme.cpp @@ -558,6 +558,11 @@ QObject *QQmlVME::run(QList<QQmlError> *errors, QObject *o = 0; void *memory = 0; type.type->create(&o, &memory, sizeof(QQmlData)); + + if (!o) + VME_EXCEPTION(tr("Unable to create object of type %1").arg(type.type->elementName()), + instr.line); + QQmlData *ddata = new (memory) QQmlData; ddata->ownMemory = false; QObjectPrivate::get(o)->declarativeData = ddata; @@ -572,10 +577,6 @@ QObject *QQmlVME::run(QList<QQmlError> *errors, ddata->propertyCache->addref(); } - if (!o) - VME_EXCEPTION(tr("Unable to create object of type %1").arg(type.type->elementName()), - instr.line); - if (states.count() == 1) { // Keep a reference to the compiled data we rely on ddata->compiledData = states[0].compiledData; |