diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-04-07 03:12:06 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-04-07 04:27:47 (GMT) |
commit | 0bd3c6b059986e92ecca1c926afd123074187f49 (patch) | |
tree | bd0583d598a3dc74dfd4293f90672cdcf4f34d36 | |
parent | ec50ac021ba0908bfaeb5fbf1838ffb59ad829d5 (diff) | |
download | Qt-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.cpp | 6 |
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) { |