summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-03-24 02:42:04 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-03-24 03:30:50 (GMT)
commit364f6c200a6faac825c7f1e0158d708fc60a8ff5 (patch)
treea6c0d7632e2d06b65b5b211249b2990d1e3dd37c /src/declarative
parent30275dfcb8c5303de201bc32fba2a6b9b26fa1cd (diff)
downloadQt-364f6c200a6faac825c7f1e0158d708fc60a8ff5.zip
Qt-364f6c200a6faac825c7f1e0158d708fc60a8ff5.tar.gz
Qt-364f6c200a6faac825c7f1e0158d708fc60a8ff5.tar.bz2
Fix Loader leak when loading a non-QGraphicsObject object.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index 544e9ec..4301467 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -303,9 +303,9 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
return;
}
if (obj) {
- QDeclarative_setParent_noEvent(ctxt, obj);
item = qobject_cast<QGraphicsObject *>(obj);
if (item) {
+ QDeclarative_setParent_noEvent(ctxt, obj);
if (QDeclarativeItem* qmlItem = qobject_cast<QDeclarativeItem *>(item)) {
qmlItem->setParentItem(q);
} else {
@@ -314,6 +314,10 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
}
// item->setFocus(true);
initResize();
+ } else {
+ qmlInfo(q) << QDeclarativeLoader::tr("Loader does not support loading non-visual elements.");
+ delete obj;
+ delete ctxt;
}
} else {
delete obj;