aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp')
-rw-r--r--tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
index 582503f938..9fb76f9584 100644
--- a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
+++ b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
@@ -78,6 +78,7 @@ private slots:
void asynchronous();
void initParent();
void dynamicModelCrash();
+ void visualItemModelCrash();
};
class TestObject : public QObject
@@ -732,6 +733,17 @@ void tst_QQuickRepeater::dynamicModelCrash()
QVERIFY(qvariant_cast<QObject *>(repeater->model()) == 0);
}
+void tst_QQuickRepeater::visualItemModelCrash()
+{
+ // This used to crash because the model would get
+ // deleted before the repeater, leading to double-deletion
+ // of the items.
+ QQuickView *window = createView();
+ window->setSource(testFileUrl("visualitemmodel.qml"));
+ qApp->processEvents();
+ delete window;
+}
+
QTEST_MAIN(tst_QQuickRepeater)
#include "tst_qquickrepeater.moc"