summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp2
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp1
-rw-r--r--src/declarative/qml/qdeclarativecontext_p.h6
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeinfo.cpp2
-rw-r--r--src/declarative/qml/qdeclarativevme.cpp4
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);