diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-02-04 03:39:58 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-02-04 03:39:58 (GMT) |
commit | 4c8b9316de5728276d24f2d72599cf9c6534fced (patch) | |
tree | b726d4826db4d98fd355f0c2c8a69229cf790b6a /src/declarative/graphicsitems/qmlgraphicsloader.cpp | |
parent | 0b8ef5c78b724901cfae343920b3e9e8f4a78fda (diff) | |
parent | e1c72879ed2c25819537bc5bbb12569b705ba79f (diff) | |
download | Qt-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.cpp | 10 |
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() |