aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-02-02 13:25:59 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-02-03 11:14:57 +0100
commitad394a106b78f4acedcce62f3cc335a3a5e3e880 (patch)
tree2713e9c675e4c9bd407ddbe7d15b2ab34c8d2394
parent17fa564a94f98486ff41030c47629bd902c48e8d (diff)
Drop QQuickAnimatorProxyJob::m_animation
Keeping it around is dangerous and we only need it in the ctor. Task-number: QTBUG-90401 Change-Id: I128be1a5cef394bbf4be1a7b0e6a4595f9b25968 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r--src/quick/util/qquickanimatorjob.cpp6
-rw-r--r--src/quick/util/qquickanimatorjob_p.h3
2 files changed, 4 insertions, 5 deletions
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp
index f196005561..93d4e9a8b5 100644
--- a/src/quick/util/qquickanimatorjob.cpp
+++ b/src/quick/util/qquickanimatorjob.cpp
@@ -81,14 +81,14 @@ struct QQuickTransformAnimatorHelperStore
};
Q_GLOBAL_STATIC(QQuickTransformAnimatorHelperStore, qquick_transform_animatorjob_helper_store);
-QQuickAnimatorProxyJob::QQuickAnimatorProxyJob(QAbstractAnimationJob *job, QObject *item)
+QQuickAnimatorProxyJob::QQuickAnimatorProxyJob(QAbstractAnimationJob *job,
+ QQuickAbstractAnimation *animation)
: m_controller(nullptr)
, m_internalState(State_Stopped)
{
m_job.reset(job);
m_isRenderThreadProxy = true;
- m_animation = qobject_cast<QQuickAbstractAnimation *>(item);
setLoopCount(job->loopCount());
@@ -101,7 +101,7 @@ QQuickAnimatorProxyJob::QQuickAnimatorProxyJob(QAbstractAnimationJob *job, QObje
// be negligiblie compared to animating and re-rendering the scene on the render thread.
m_duration = -1;
- QObject *ctx = findAnimationContext(m_animation);
+ QObject *ctx = findAnimationContext(animation);
if (!ctx) {
qWarning("QtQuick: unable to find animation context for RT animation...");
return;
diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h
index c79c5341bc..2aa0e1a380 100644
--- a/src/quick/util/qquickanimatorjob_p.h
+++ b/src/quick/util/qquickanimatorjob_p.h
@@ -77,7 +77,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickAnimatorProxyJob : public QObject, public QAb
Q_OBJECT
public:
- QQuickAnimatorProxyJob(QAbstractAnimationJob *job, QObject *item);
+ QQuickAnimatorProxyJob(QAbstractAnimationJob *job, QQuickAbstractAnimation *animation);
~QQuickAnimatorProxyJob();
int duration() const override { return m_duration; }
@@ -101,7 +101,6 @@ private:
static QObject *findAnimationContext(QQuickAbstractAnimation *);
QPointer<QQuickAnimatorController> m_controller;
- QQuickAbstractAnimation *m_animation;
QSharedPointer<QAbstractAnimationJob> m_job;
int m_duration;