summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeloader.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-06-29 00:43:42 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-06-29 00:43:42 (GMT)
commit189d2660968368532761586ffd495eb6c18cdbdf (patch)
tree36edb9c9da0c366cb8b00015f3cc52929575111a /src/declarative/graphicsitems/qdeclarativeloader.cpp
parent5b0de255d1facfe89efed393447a1c914ffdf414 (diff)
downloadQt-189d2660968368532761586ffd495eb6c18cdbdf.zip
Qt-189d2660968368532761586ffd495eb6c18cdbdf.tar.gz
Qt-189d2660968368532761586ffd495eb6c18cdbdf.tar.bz2
Ensure Loader item change listener is removed when Loader is destroyed
Task-number: QTBUG-11771
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeloader.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index 25b1119..c8c9e44 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -174,7 +174,7 @@ void QDeclarativeLoaderPrivate::initResize()
QDeclarativeLoader::QDeclarativeLoader(QDeclarativeItem *parent)
: QDeclarativeItem(*(new QDeclarativeLoaderPrivate), parent)
{
- Q_D(QDeclarativeItem);
+ Q_D(QDeclarativeLoader);
d->flags |= QGraphicsItem::ItemIsFocusScope;
}
@@ -183,6 +183,14 @@ QDeclarativeLoader::QDeclarativeLoader(QDeclarativeItem *parent)
*/
QDeclarativeLoader::~QDeclarativeLoader()
{
+ Q_D(QDeclarativeLoader);
+ if (d->item) {
+ if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(d->item)) {
+ QDeclarativeItemPrivate *p =
+ static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(qmlItem));
+ p->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
+ }
+ }
}
/*!