Commit 114c9a16 authored by Kai Koehne's avatar Kai Koehne Committed by The Qt Project
Browse files

Animations: Avoid accessing invalid memory if stop() triggers deletion


Return immediately if calling stop() results in the current object being
deleted.

Task-number: QTBUG-31247
Change-Id: I684a858bfb4cc53f415daa8cc1c4df96067daa1c
Reviewed-by: default avatarAlan Alpert <aalpert@blackberry.com>
parent 56c1111d
No related merge requests found
Showing with 2 additions and 2 deletions
...@@ -226,14 +226,14 @@ void QSequentialAnimationGroupJob::updateCurrentTime(int currentTime) ...@@ -226,14 +226,14 @@ void QSequentialAnimationGroupJob::updateCurrentTime(int currentTime)
if (atEnd()) { if (atEnd()) {
//we make sure that we don't exceed the duration here //we make sure that we don't exceed the duration here
m_currentTime += m_currentAnimation->currentTime() - newCurrentTime; m_currentTime += m_currentAnimation->currentTime() - newCurrentTime;
stop(); RETURN_IF_DELETED(stop());
} }
} else { } else {
//the only case where currentAnimation could be null //the only case where currentAnimation could be null
//is when all animations have been removed //is when all animations have been removed
Q_ASSERT(!firstChild()); Q_ASSERT(!firstChild());
m_currentTime = 0; m_currentTime = 0;
stop(); RETURN_IF_DELETED(stop());
} }
m_previousLoop = m_currentLoop; m_previousLoop = m_currentLoop;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment