diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-03-17 15:23:55 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-03-19 07:53:39 +0000 |
commit | eb52c31c5b8cb6f05fce598519034c4fc32c4c3f (patch) | |
tree | 111328b7bf72942ebcebeffd5daf79421d37e051 /tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp | |
parent | b7986a8f6e9df3727f433a0df0ba56a3355153d0 (diff) |
When clearing selected items, iterate over a copy of the QSet
Selection change handlers of the items might call a method that
implicitly recreates the selectedItems QSet, which then invalidates
the iterators of the ranged for loop, resulting in crashes.
Iterate over a copy of the set instead.
Add a test case that crashen without the fix.
Fixes: QTBUG-101651
Change-Id: I6da6f4043fe1906b0186931a37283f635cb5a404
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 5e566ab373bd6161f82b00c5a1f24bd210051140)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp')
0 files changed, 0 insertions, 0 deletions