aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickanimatorjob_p.h
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2015-12-07 09:04:00 +0100
committerPaul Lemire <paul.lemire@kdab.com>2015-12-07 14:54:18 +0000
commitf9f99c43fbea600f61d065b30a5453e95dfa6ade (patch)
tree038fc2abe32b84a4b8053fd37f0357c03d3f3e72 /src/quick/util/qquickanimatorjob_p.h
parent94e9fab2d81d076fd59a6a5a4d4ef093f37e05f9 (diff)
QQuickAnimatorJob: store the target with a QPointer
This avoids ending up with invalid pointers when under some circumstances the target (which is not owned by the QQuickAnimatorJob) is destroyed between the time the QQuickAnimatorJob is created and the time it is initialized. This is the case when the target of an Animator is the item loaded by a Loader and that the animator is started just before setting the Loader to inactive. Also added an auto test for that special case. Task-number: QTBUG-49634 Change-Id: Iab9bfe76d13755ba735432c6f97bde175d308814 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/util/qquickanimatorjob_p.h')
-rw-r--r--src/quick/util/qquickanimatorjob_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h
index 82c9da1d2e..35057d6278 100644
--- a/src/quick/util/qquickanimatorjob_p.h
+++ b/src/quick/util/qquickanimatorjob_p.h
@@ -152,7 +152,7 @@ protected:
QQuickAnimatorJob();
void debugAnimation(QDebug d) const Q_DECL_OVERRIDE;
- QQuickItem *m_target;
+ QPointer<QQuickItem> m_target;
QQuickAnimatorController *m_controller;
qreal m_from;