aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickanimatorjob_p.h
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2014-05-15 21:01:06 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-19 11:15:08 +0200
commit851ae1a77dc207ec11b8ed3f0786bfe1c1905e4c (patch)
tree6576f581a94851366e4481ea6994b610636f5fe0 /src/quick/util/qquickanimatorjob_p.h
parent8f6254a88e4c634203df779aa385d9955e91b56f (diff)
Fix crash with running animators on re-shown windows.
The non-threaded render loops would clean up the nodes for a window when it was hidden, but the animators kept running and had a reference to the deleted nodes. This was not a problem for the threaded render loop as it would wipe the animator controller as well which would clean the jobs. Fix it by triggering a reset of all nodes in the animators when the window is told to clean up. If an animator is ticked when it doesn't have a node, it will simply do nothing. When the window is made visible again, we call initialize on all animators to find the new node. Task-number: QTBUG-37995 Change-Id: Ie5609d95db29f4b2b30ca5bf641dce901e528389 Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/quick/util/qquickanimatorjob_p.h')
-rw-r--r--src/quick/util/qquickanimatorjob_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h
index 8aae121106..03b13bcd30 100644
--- a/src/quick/util/qquickanimatorjob_p.h
+++ b/src/quick/util/qquickanimatorjob_p.h
@@ -131,6 +131,7 @@ public:
void targetWasDeleted();
virtual void initialize(QQuickAnimatorController *controller);
virtual void writeBack() = 0;
+ virtual void nodeWasDestroyed() = 0;
bool isTransform() const { return m_isTransform; }
bool isUniform() const { return m_isUniform; }
@@ -208,6 +209,7 @@ public:
protected:
QQuickTransformAnimatorJob();
void initialize(QQuickAnimatorController *controller);
+ void nodeWasDestroyed();
Helper *m_helper;
};
@@ -256,6 +258,7 @@ public:
void initialize(QQuickAnimatorController *controller);
void updateCurrentTime(int time);
void writeBack();
+ void nodeWasDestroyed();
private:
QSGOpacityNode *m_opacityNode;
@@ -275,6 +278,7 @@ public:
void updateCurrentTime(int time);
void writeBack();
+ void nodeWasDestroyed();
private:
QByteArray m_uniform;