diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2023-03-13 14:53:39 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2023-06-13 20:35:32 +0200 |
commit | 8a74155411d7a22bb8efa405fe59a681e47e6b45 (patch) | |
tree | 50c26f7191fb511bdb148d7d56538f5000579114 /src/qml | |
parent | aea823b493d0779c1019b27fc8a2203fe162f235 (diff) |
PropertyAnimation: Handle targets being deleted
QQuickPropertyAnimation does not own the targets in its targets list.
Thus, we need to be careful to not access deleted objects. Calling
QQmlData::wasDeleted is not enoguh, as the object might be fully
deleted, but we'd still have a dangling pointer to it.
Fix the issue by using QPointer. A similar issue might exists for
target, but there we don't normally end up with dangling references -
the engine will correctly null the target. And the QPointer isNull
check will avoid potentiall nullptr derefences there, too.
Ideally, we would use QQmlGuard instead of QPointer, as it would have a
lower overhead - however, we run into linker issues on MSVC. Fixing them
is deferred to a future commit, to not block this crash fix.
Fixes: QTBUG-100392
Pick-to: 6.5 6.6 6.2
Change-Id: If084e2e0f22d50dbee8bf5aedfa2e749e79fc105
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/qml')
0 files changed, 0 insertions, 0 deletions