Change repeater item to handle model being deleted.
authorGlenn Watson <glenn.watson@nokia.com>
Mon, 12 Mar 2012 03:20:22 +0000 (13:20 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 13 Mar 2012 01:02:49 +0000 (02:02 +0100)
commitbe8675ab01132ffb03b81cc81842775d6a8fa3f9
treeb7126d1fc348b8fe7393ebf646d5c92fa40c1cbc
parentfc5ddb181896d3a364c046ae21b61283412fc722
Change repeater item to handle model being deleted.

The repeater item previously stored a raw QObject pointer in
a variant. When this pointer was a dynamic list model element
that was deleted, the variant would continue to hold a stale
pointer. Change repeater to use a guard object to hold the model
when it is a QObject. Continue to use a variant to hold models
that are not based on QObject to maintain same semantics.

Change-Id: Ie100947132923803263c725e86efa68206382f12
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/items/qquickrepeater.cpp
src/quick/items/qquickrepeater_p_p.h
tests/auto/quick/qquickrepeater/data/dynamicmodelcrash.qml [new file with mode: 0644]
tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp