diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-11-17 11:05:35 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-11-24 10:36:54 +0000 |
commit | 36a7259405aae9ce1ea474e28029e42db7d589fc (patch) | |
tree | 28d1098d7937ca940669a2827cc1aa52270f56c0 /examples/quick/CMakeLists.txt | |
parent | 04cd27e43a247177693eab80ac077a2c681e1373 (diff) |
Unset the QQmlAnimationTimer pointer from unregistered jobs
Amends 4b125a5bfdd935d260118406c343535e76023200, which reset the pointer
in registered jobs when the timer was destroyed. However, if a job is
unregistered explicitly before the timer is destroyed, then the job's
m_timer pointer might still be a dangling pointer, resulting in a crash
when the job is reactivated later.
So clear the job's pointer to QQmlAnimationTimer whenever it is
unregistered from the timer. Since a running job can then have a nullptr
timer, only assert in the job's destructor if the timer is not nullptr.
Introduce a test case that reliably crashes without the fix. The test
is added to the QQuickAnimation test as it uses a Qt Quick UI.
Fixes: QTBUG-98248
Change-Id: Ief991900c50aefd480d9c79e83324968102ca29c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 9c732286ed72afe8cc2d2062e6cedbe5f6a06447)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/quick/CMakeLists.txt')
0 files changed, 0 insertions, 0 deletions