tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
branchRCL_3
changeset 7 3f74d0d4af4c
parent 4 3b1da2848fc7
--- a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp	Mon Mar 15 12:43:09 2010 +0200
+++ b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp	Thu Apr 08 14:19:33 2010 +0300
@@ -75,6 +75,8 @@
     void loopCount();
     void autoAdd();
     void pauseResume();
+
+    void QTBUG8910_crashWhenRemovingUncontrolledAnimation();
 };
 
 tst_QParallelAnimationGroup::tst_QParallelAnimationGroup()
@@ -999,9 +1001,22 @@
     QCOMPARE(spy.count(), 2); //this shouldn't have changed
     group.resume();
     QCOMPARE(spy.count(), 2); //this shouldn't have changed
+}
 
 
-
+void tst_QParallelAnimationGroup::QTBUG8910_crashWhenRemovingUncontrolledAnimation()
+{
+    QParallelAnimationGroup group;
+    TestAnimation *anim = new TestAnimation;
+    anim->setLoopCount(-1);
+    TestAnimation *anim2 = new TestAnimation;
+    anim2->setLoopCount(-1);
+    group.addAnimation(anim);
+    group.addAnimation(anim2);
+    group.start();
+    delete anim;
+    // it would crash here because the internals of the group would still have a reference to anim
+    delete anim2;
 }