summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorArmin Berres <armin.berres@basyskom.de>2011-11-10 17:34:55 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-23 13:06:12 +0100
commitd0cb57a4e7c028117c253726a15dd60099e7cc8a (patch)
tree3c1d8ea9eab963fa60556e95d97d712d9bb656d9 /src/corelib
parent43696a9e4230ae1952fa9d8d6ef400d7df0f1c6e (diff)
QPropertyAnimation::setTargetObject() fails if new and old target object have the same address
If a target object is destroyed QPropertyAnimationPrivate::targetValue reflects this while QPropertyAnimationPrivate::target stays unchanged. QPropertyAnimation::setTargetObject() checks if a new target matches QPropertyAnimationPrivate::target - to bad if the former target has been destroyed in the meanwhile but the new one has the same memory address. targetValue is not updated in this case. It will still point to null and QPropertyAnimation::targetObject() returns 0. This is not just a theoretical problem - we stubled upon this in Harmattan when suddenly animations complained that they are having no target. Change-Id: Ib4a9c234d04d6f8a3f7aed251d5e79471d95168a Reviewed-by: Leonardo Sobral Cunha <leo.cunha@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/animation/qpropertyanimation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index 816c725ebc..a18f0f1a70 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -187,7 +187,7 @@ QObject *QPropertyAnimation::targetObject() const
void QPropertyAnimation::setTargetObject(QObject *target)
{
Q_D(QPropertyAnimation);
- if (d->targetValue == target)
+ if (d->target.data() == target)
return;
if (d->state != QAbstractAnimation::Stopped) {