diff options
author | Charles Yin <charles.yin@nokia.com> | 2012-03-09 11:34:18 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-12 00:59:34 +0100 |
commit | ebd9af56a3e9383682db04b2b7ff53fa0a51ee30 (patch) | |
tree | f25666159ec20d900dc984a6b4f83dee28947b29 /src/qml/animations | |
parent | d4c25e803bc362e33cacbd20af00cb199204bda3 (diff) |
Return early if animationjob was deleted in all callback methods.
Change-Id: I703c8a8904ffd760683de4ee74544dff9eb53144
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/qml/animations')
-rw-r--r-- | src/qml/animations/qabstractanimationjob.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp index 2bfc66fea0..a540382847 100644 --- a/src/qml/animations/qabstractanimationjob.cpp +++ b/src/qml/animations/qabstractanimationjob.cpp @@ -499,8 +499,9 @@ void QAbstractAnimationJob::finished() //TODO: update this code so it is valid to delete the animation in animationFinished for (int i = 0; i < changeListeners.count(); ++i) { const QAbstractAnimationJob::ChangeListener &change = changeListeners.at(i); - if (change.types & QAbstractAnimationJob::Completion) - change.listener->animationFinished(this); + if (change.types & QAbstractAnimationJob::Completion) { + RETURN_IF_DELETED(change.listener->animationFinished(this)); + } } if (m_group && (duration() == -1 || loopCount() < 0)) { @@ -513,8 +514,9 @@ void QAbstractAnimationJob::stateChanged(QAbstractAnimationJob::State newState, { for (int i = 0; i < changeListeners.count(); ++i) { const QAbstractAnimationJob::ChangeListener &change = changeListeners.at(i); - if (change.types & QAbstractAnimationJob::StateChange) - change.listener->animationStateChanged(this, newState, oldState); + if (change.types & QAbstractAnimationJob::StateChange) { + RETURN_IF_DELETED(change.listener->animationStateChanged(this, newState, oldState)); + } } } @@ -523,8 +525,9 @@ void QAbstractAnimationJob::currentLoopChanged(int currentLoop) Q_UNUSED(currentLoop); for (int i = 0; i < changeListeners.count(); ++i) { const QAbstractAnimationJob::ChangeListener &change = changeListeners.at(i); - if (change.types & QAbstractAnimationJob::CurrentLoop) - change.listener->animationCurrentLoopChanged(this); + if (change.types & QAbstractAnimationJob::CurrentLoop) { + RETURN_IF_DELETED(change.listener->animationCurrentLoopChanged(this)); + } } } |