summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qmlgraphicsloader.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-02-04 03:39:58 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-02-04 03:39:58 (GMT)
commit4c8b9316de5728276d24f2d72599cf9c6534fced (patch)
treeb726d4826db4d98fd355f0c2c8a69229cf790b6a /src/declarative/graphicsitems/qmlgraphicsloader.cpp
parent0b8ef5c78b724901cfae343920b3e9e8f4a78fda (diff)
parente1c72879ed2c25819537bc5bbb12569b705ba79f (diff)
downloadQt-4c8b9316de5728276d24f2d72599cf9c6534fced.zip
Qt-4c8b9316de5728276d24f2d72599cf9c6534fced.tar.gz
Qt-4c8b9316de5728276d24f2d72599cf9c6534fced.tar.bz2
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicsloader.cpp')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsloader.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsloader.cpp b/src/declarative/graphicsitems/qmlgraphicsloader.cpp
index bb1020c..7cd4d1a 100644
--- a/src/declarative/graphicsitems/qmlgraphicsloader.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsloader.cpp
@@ -64,8 +64,14 @@ void QmlGraphicsLoaderPrivate::clear()
}
source = QUrl();
- delete item;
- item = 0;
+ if (item) {
+ // We can't delete immediately because our item may have triggered
+ // the Loader to load a different item.
+ item->setVisible(false);
+ static_cast<QGraphicsItem*>(item)->setParentItem(0);
+ item->deleteLater();
+ item = 0;
+ }
}
void QmlGraphicsLoaderPrivate::initResize()