diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/util/qquickanimatorcontroller.cpp | 5 | ||||
-rw-r--r-- | src/quick/util/qquickanimatorjob_p.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/quick/util/qquickanimatorcontroller.cpp b/src/quick/util/qquickanimatorcontroller.cpp index cfb6037d14..74930fb373 100644 --- a/src/quick/util/qquickanimatorcontroller.cpp +++ b/src/quick/util/qquickanimatorcontroller.cpp @@ -140,6 +140,11 @@ static void qquick_initialize_helper(QAbstractAnimationJob *job, QQuickAnimatorC { if (job->isRenderThreadJob()) { QQuickAnimatorJob *j = static_cast<QQuickAnimatorJob *>(job); + // Note: since a QQuickAnimatorJob::m_target is a QPointer, + // if m_target is destroyed between the time it was set + // as the target of the animator job and before this step, + // (e.g a Loader being set inactive just after starting the animator) + // we are sure it will be NULL and won't be dangling around if (!j->target()) { return; } else if (c->m_deletedSinceLastFrame.contains(j->target())) { 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; |