diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-09-08 13:10:21 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-09-08 13:10:21 +0200 |
commit | 38fe461e2cc4bf3aebcb98d25c643bfe6653120a (patch) | |
tree | b625415f33791ce0202538396509379fd04b111a /src/quick/util | |
parent | f9ee33f9683a4cd4d1a2e41efa6e8d124e9d731d (diff) | |
parent | f7c3035fa1d965dceb36892122683a5ceb6cab89 (diff) |
Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts:
.qmake.conf
src/qml/jsruntime/qv4arraydata.cpp
src/quick/scenegraph/util/qsgatlastexture.cpp
Change-Id: Ic4c96066d5c37dcf0d5446baed590ea005d445ce
Diffstat (limited to 'src/quick/util')
-rw-r--r-- | src/quick/util/qquickanimatorcontroller.cpp | 1 | ||||
-rw-r--r-- | src/quick/util/qquickanimatorjob.cpp | 14 | ||||
-rw-r--r-- | src/quick/util/qquickanimatorjob_p.h | 4 |
3 files changed, 14 insertions, 5 deletions
diff --git a/src/quick/util/qquickanimatorcontroller.cpp b/src/quick/util/qquickanimatorcontroller.cpp index 01f182c35d..42b8840bf4 100644 --- a/src/quick/util/qquickanimatorcontroller.cpp +++ b/src/quick/util/qquickanimatorcontroller.cpp @@ -254,6 +254,7 @@ void QQuickAnimatorController::requestSync() // These functions are called on the GUI thread. void QQuickAnimatorController::startJob(QQuickAnimatorProxyJob *proxy, QAbstractAnimationJob *job) { + proxy->markJobManagedByController(); m_starting[job] = proxy; requestSync(); } diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp index 741fa9bb7f..3725e22397 100644 --- a/src/quick/util/qquickanimatorjob.cpp +++ b/src/quick/util/qquickanimatorjob.cpp @@ -49,6 +49,7 @@ QQuickAnimatorProxyJob::QQuickAnimatorProxyJob(QAbstractAnimationJob *job, QObje : m_controller(0) , m_job(job) , m_internalState(State_Stopped) + , m_jobManagedByController(false) { m_isRenderThreadProxy = true; m_animation = qobject_cast<QQuickAbstractAnimation *>(item); @@ -93,7 +94,10 @@ void QQuickAnimatorProxyJob::deleteJob() // so delete it through the controller to clean up properly. if (m_controller) m_controller->deleteJob(m_job); - else + + // We explicitly delete the job if the animator controller has never touched + // it. If it has, it will have ownership as well. + else if (!m_jobManagedByController) delete m_job; m_job = 0; } @@ -141,11 +145,13 @@ void QQuickAnimatorProxyJob::controllerWasDeleted() void QQuickAnimatorProxyJob::setWindow(QQuickWindow *window) { if (!window) { - // Stop will trigger syncBackCurrentValues so best to do it before - // we delete m_job. stop(); deleteJob(); - return; + + // Upon leaving a window, we reset the controller. This means that + // animators will only enter the Starting phase and won't be making + // calls to QQuickAnimatorController::startjob(). + m_controller = 0; } else if (!m_controller && m_job) { m_controller = QQuickWindowPrivate::get(window)->animationController; diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h index 7c6ad823b3..f91410950c 100644 --- a/src/quick/util/qquickanimatorjob_p.h +++ b/src/quick/util/qquickanimatorjob_p.h @@ -69,6 +69,7 @@ public: void startedByController(); void controllerWasDeleted(); + void markJobManagedByController() { m_jobManagedByController = true; } protected: bool event(QEvent *); @@ -87,7 +88,7 @@ private: void setWindow(QQuickWindow *window); static QObject *findAnimationContext(QQuickAbstractAnimation *); - QQuickAnimatorController *m_controller; + QPointer<QQuickAnimatorController> m_controller; QQuickAbstractAnimation *m_animation; QAbstractAnimationJob *m_job; int m_duration; @@ -100,6 +101,7 @@ private: }; InternalState m_internalState; + bool m_jobManagedByController; }; class Q_QUICK_PRIVATE_EXPORT QQuickAnimatorJob : public QAbstractAnimationJob |