Don't leak objects when a VisualDataModel is destroyed before a view.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Wed, 16 Nov 2011 03:08:16 +0000 (13:08 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 21 Nov 2011 05:16:30 +0000 (06:16 +0100)
commita45c4ce878e49c3d2b0e5525fe6b6cbf8cceef99
tree4598c0190ae0ad499e5aea392dcf722d63999a56
parent2b3328fc4df942954d6b9d7c134d8d55c66d38c5
Don't leak objects when a VisualDataModel is destroyed before a view.

If an item is still referenced by a view when the VisualDataModel is
destroyed delete it, otherwise it will leak as the view have no
interface to release it and deleting the item won't delete the package.

Task-number: QTBUG-22672
Change-Id: I7b89962d724d7a391c97722638e03b7a186b8a8f
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
src/declarative/items/qquickvisualdatamodel.cpp
tests/auto/declarative/qquickvisualdatamodel/data/itemsDestroyed_listView.qml [new file with mode: 0644]
tests/auto/declarative/qquickvisualdatamodel/data/itemsDestroyed_package.qml [new file with mode: 0644]
tests/auto/declarative/qquickvisualdatamodel/data/itemsDestroyed_pathView.qml [new file with mode: 0644]
tests/auto/declarative/qquickvisualdatamodel/data/itemsDestroyed_repeater.qml [new file with mode: 0644]
tests/auto/declarative/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp