Before removing and deleting children, set the m_group to 0 to avoid potential
cycling deletions when this method is called from QAnimationGroupJob::~QAnimationGroupJob().
Change-Id: Idb6920be71fc9e033e5a76b724c9550018995035
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
QAnimationGroupJob::~QAnimationGroupJob()
{
- while (firstChild() != 0)
- delete firstChild();
+ clear();
}
void QAnimationGroupJob::topLevelAnimationLoopChanged()
void QAnimationGroupJob::clear()
{
- //### should this remove and delete, or just remove?
- while (firstChild() != 0)
- delete firstChild(); //removeAnimation(firstChild());
+ QAbstractAnimationJob *child = firstChild();
+ QAbstractAnimationJob *nextSibling = 0;
+ while (child != 0) {
+ child->m_group = 0;
+ nextSibling = child->nextSibling();
+ delete child;
+ child = nextSibling;
+ }
+ m_firstChild = 0;
+ m_lastChild = 0;
}
void QAnimationGroupJob::resetUncontrolledAnimationsFinishTime()