diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-15 08:01:04 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-17 00:20:50 (GMT) |
commit | 34f0d9de68963499bfbc245639d0a099433734b1 (patch) | |
tree | 10ca954f11fc5bfe6dfe357b1a52d454483d9d51 | |
parent | 48f89845732b2bf6b9e7a6dbe98efd6dfd5e3cff (diff) | |
download | Qt-34f0d9de68963499bfbc245639d0a099433734b1.zip Qt-34f0d9de68963499bfbc245639d0a099433734b1.tar.gz Qt-34f0d9de68963499bfbc245639d0a099433734b1.tar.bz2 |
Fix test failures
-rw-r--r-- | src/declarative/qml/qdeclarativecomponent.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativecontext.cpp | 1 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativecontext_p.h | 6 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeenginedebug.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeinfo.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativevme.cpp | 4 |
6 files changed, 11 insertions, 6 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index ffbd0fa..a280d7e 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -617,8 +617,6 @@ QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context, cons QObject *rv = begin(ctxt, ep, cc, start, count, &state, bindings); - if (!rv) ctxt->destroy(); - if (rv && !context->isInternal && ep->isDebugging) context->asQDeclarativeContextPrivate()->instances.append(rv); diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp index f1c961d..60fc1d1 100644 --- a/src/declarative/qml/qdeclarativecontext.cpp +++ b/src/declarative/qml/qdeclarativecontext.cpp @@ -624,6 +624,7 @@ void QDeclarativeContextData::addScript(const QDeclarativeParser::Object::Script void QDeclarativeContextData::setIdProperty(int idx, QObject *obj) { idValues[idx] = obj; + idValues[idx].context = this; } void QDeclarativeContextData::setIdPropertyData(QDeclarativeIntegerCache *data) diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h index 59b848f..d74aa33 100644 --- a/src/declarative/qml/qdeclarativecontext_p.h +++ b/src/declarative/qml/qdeclarativecontext_p.h @@ -168,9 +168,13 @@ public: // id guards struct ContextGuard : public QDeclarativeGuard<QObject> { + ContextGuard() : context(0) {} inline ContextGuard &operator=(QObject *obj) { QDeclarativeGuard<QObject>::operator=(obj); return *this; } - virtual void objectDestroyed(QObject *) { bindings.notify(); } + virtual void objectDestroyed(QObject *) { + if (!QObjectPrivate::get(context->contextObject)->wasDeleted) bindings.notify(); + } + QDeclarativeContextData *context; QDeclarativeNotifier bindings; }; ContextGuard *idValues; diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index da73178..a377b35 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -266,7 +266,7 @@ QDeclarativeEngineDebugServer::objectData(QObject *object) { QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(object); QDeclarativeObjectData rv; - if (ddata) { + if (ddata && ddata->outerContext) { rv.url = ddata->outerContext->url; rv.lineNumber = ddata->lineNumber; rv.columnNumber = ddata->columnNumber; diff --git a/src/declarative/qml/qdeclarativeinfo.cpp b/src/declarative/qml/qdeclarativeinfo.cpp index 87a9254..5146bb6 100644 --- a/src/declarative/qml/qdeclarativeinfo.cpp +++ b/src/declarative/qml/qdeclarativeinfo.cpp @@ -103,7 +103,7 @@ QDeclarativeInfo::QDeclarativeInfo(const QObject *object) QDeclarativeDeclarativeData *ddata = object?QDeclarativeDeclarativeData::get(object):0; pos += QLatin1String(" ("); if (ddata) { - if (ddata->outerContext) { + if (ddata->outerContext && !ddata->outerContext->url.isEmpty()) { pos += ddata->outerContext->url.toString(); pos += QLatin1Char(':'); pos += QString::number(ddata->lineNumber); diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp index b3c07f5..4457404 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/declarative/qml/qdeclarativevme.cpp @@ -844,7 +844,9 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, if (isError()) { if (!stack.isEmpty()) { - delete stack.at(0); + delete stack.at(0); // ### What about failures in deferred creation? + } else { + ctxt->destroy(); } QDeclarativeEnginePrivate::clear(bindValues); |