summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-04-07 03:12:06 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-04-07 04:27:47 (GMT)
commit0bd3c6b059986e92ecca1c926afd123074187f49 (patch)
treebd0583d598a3dc74dfd4293f90672cdcf4f34d36
parentec50ac021ba0908bfaeb5fbf1838ffb59ad829d5 (diff)
downloadQt-0bd3c6b059986e92ecca1c926afd123074187f49.zip
Qt-0bd3c6b059986e92ecca1c926afd123074187f49.tar.gz
Qt-0bd3c6b059986e92ecca1c926afd123074187f49.tar.bz2
Make sure Loader doesn't leak when component has errors.
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index 2aab36f..409c228 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -276,9 +276,6 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
Q_Q(QDeclarativeLoader);
if (component) {
- QDeclarativeContext *ctxt = new QDeclarativeContext(qmlContext(q));
- ctxt->setContextObject(q);
-
if (!component->errors().isEmpty()) {
qWarning() << component->errors();
emit q->sourceChanged();
@@ -287,6 +284,9 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
return;
}
+ QDeclarativeContext *ctxt = new QDeclarativeContext(qmlContext(q));
+ ctxt->setContextObject(q);
+
QDeclarativeComponent *c = component;
QObject *obj = component->create(ctxt);
if (component != c) {