diff options
author | Martin T. H. Sandsmark <martin.sandsmark@kde.org> | 2017-03-12 15:03:56 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@crimson.no> | 2017-04-05 20:56:31 +0000 |
commit | 8b255c67b965cda334425d64a0f1fd13ace93584 (patch) | |
tree | e41a9e8326e7fff9d5915111efb7849af57fe5dd /tests/auto/particles/qquickparticlesystem/tst_qquickparticlesystem.cpp | |
parent | 22c39eda8ab316c743d0beac62a9745fd82147f7 (diff) |
QQuickParticleSystem: Fix crash when an Affector dies
A guarded pointer wasn't checked before being de-referenced, that lead
to a crash if an emitter was modified after an affector was deleted, but
before updateCurrentTime() was called.
Change-Id: I6cb605a711319fb77c1e2e87fa9f35427cd7797b
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'tests/auto/particles/qquickparticlesystem/tst_qquickparticlesystem.cpp')
-rw-r--r-- | tests/auto/particles/qquickparticlesystem/tst_qquickparticlesystem.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/particles/qquickparticlesystem/tst_qquickparticlesystem.cpp b/tests/auto/particles/qquickparticlesystem/tst_qquickparticlesystem.cpp index 5c82b946e5..5f9db12144 100644 --- a/tests/auto/particles/qquickparticlesystem/tst_qquickparticlesystem.cpp +++ b/tests/auto/particles/qquickparticlesystem/tst_qquickparticlesystem.cpp @@ -42,6 +42,7 @@ public: private slots: void initTestCase(); void test_basic(); + void test_affectorscrash(); }; void tst_qquickparticlesystem::initTestCase() @@ -78,6 +79,12 @@ void tst_qquickparticlesystem::test_basic() delete view; QVERIFY(extremelyFuzzyCompare(stillAlive, 500, 5));//Small simulation variance is permissible. } +void tst_qquickparticlesystem::test_affectorscrash() +{ + QScopedPointer<QQuickView> view (createView(testFileUrl("crashaffectors.qml"), 600)); + + // This should have crashed by now +} QTEST_MAIN(tst_qquickparticlesystem); |