diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-07-21 15:57:09 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-07-23 22:37:03 +0000 |
commit | 4b125a5bfdd935d260118406c343535e76023200 (patch) | |
tree | 2f15af6714e43425eece13906baa1c53b09fa7c8 /src/quick/items/qquicktextinput_p.h | |
parent | 4bb54ee50eb8bbaf0b7d2f48e0ab8d324f304f1a (diff) |
Reset the timer of all controlled animations upon timer destruction
Fixes a crash when quitting an application while an animation parented
within the regular item tree is running. This amends
0e797296f9bb590926803463c32681e7fcd46064, which only turned the crash
into a Q_ASSERT failure.
As the render thread exits, the QThreadStorage destroys the timer.
That left the m_timer of the QAbstractAnimationJob a dangling pointer,
so we need to iterate over all registered animtation, and reset that
pointer to nullptr.
The animation jobs will then be destroyed later as part of regular object
tree cleanup. They will set their state to Stopped, which attempted
to unregister from the timer, creating one if needed. This also crashed
as the QThread was already finished. Don't create the timer if all we
want to do is stop the animation anyway.
Since testing this requires control over the thread lifecycle, this fix
does not come with an auto test.
Change-Id: Ice0c83818dd712c9e3be1261b79631f639de61a0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 66a5167dab35aedf1c7bef3e0f8deea903c12a5e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/items/qquicktextinput_p.h')
0 files changed, 0 insertions, 0 deletions