diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2014-08-22 09:52:59 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@digia.com> | 2014-08-25 14:41:34 +0200 |
commit | 99fd3a6b22a7eabf2aff656a942b0b7e32093254 (patch) | |
tree | 42dfa3ea9d15a65b14dece777a4f9d0f20a97c2a /tests | |
parent | 916ced089f37d96ca8ef1cdb938791247bd44b72 (diff) |
Remove references transforms have to items in QQuickItem's destructor.
In case they try to remove themselves from our list of transforms when
that list has already been destroyed after ~QQuickItem() has run.
Task-number: QTBUG-40877
Change-Id: Ie57f5dd1e8b791846f08629183974c771553c4bf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquickitem/data/objectChildTransform.qml | 31 | ||||
-rw-r--r-- | tests/auto/quick/qquickitem/tst_qquickitem.cpp | 13 |
2 files changed, 44 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickitem/data/objectChildTransform.qml b/tests/auto/quick/qquickitem/data/objectChildTransform.qml new file mode 100644 index 0000000000..fecb9ac921 --- /dev/null +++ b/tests/auto/quick/qquickitem/data/objectChildTransform.qml @@ -0,0 +1,31 @@ +import QtQuick 2.3 + +Rectangle { + width: 360 + height: 360 + + property alias loaderSource: loader.source + + Component { + id: crashComponent + + Item { + Image { + transform: scale + } + + Scale { + id: scale + xScale: 1 + yScale: 1 + } + } + } + + Loader { + id: loader + anchors.fill: parent + sourceComponent: crashComponent + } +} + diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp index a689887977..38dc8e0ac4 100644 --- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp @@ -167,6 +167,8 @@ private slots: void testSGInitializeAndInvalidate(); + void objectChildTransform(); + private: enum PaintOrderOp { @@ -1906,7 +1908,18 @@ void tst_qquickitem::testSGInitializeAndInvalidate() delete view.take(); QCOMPARE(invalidateSpy.size(), expected); } +} + +void tst_qquickitem::objectChildTransform() +{ + QQuickView view; + view.setSource(testFileUrl("objectChildTransform.qml")); + + QQuickItem *root = qobject_cast<QQuickItem*>(view.rootObject()); + QVERIFY(root); + root->setProperty("source", QString()); + // Shouldn't crash. } QTEST_MAIN(tst_qquickitem) |