qt5base-lts/tests/auto
Fabian Kosmale cb30e45b9a Avoid capturing same property twice
Avoid capturing the same property multiple times in a binding by
storing them in the BindingEvaluationState. We store them in a
QVarLengthArray array, as the number of properties involved in a binding
is expected to be rather low, so a linear scan is fine.

Avoiding double capture is a good idea in general, as we would otherwise
needlessly reevaluate bindings multiple times, and also needlessly
allocate memory for further observers, instead of using a binding's
inline observer array.

Even more importantantly, our notification code makes assumptions that
notify will visit bindings only exactly once. Not upholding that
invariant leads to memory corruption and subsequent crashes, as
observers allocated by the binding would get freed, even though we would
still access them later.

Fixes: QTBUG-112822
Pick-to: 6.5 6.2
Change-Id: Icdc1f43fe554df6fa69e881872b2c429d5fa0bbc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-04-18 13:23:48 +02:00
..
bic/data Revert "Revert "Add binary compatibility file generated against 6.4.0"" 2023-01-23 14:51:55 +00:00
cmake Fix for CMake tests when build with unity 2023-03-14 17:28:43 +01:00
concurrent tst_qtconcurrentrun: fix UB (uninit'ed values) 2023-03-31 11:32:46 +02:00
corelib Avoid capturing same property twice 2023-04-18 13:23:48 +02:00
dbus QThread: add sleep(std::chrono::nanoseconds) overload 2023-03-13 23:26:28 +02:00
gui Test for QWindow getting enter/leave events when secondary window shows/hides 2023-04-14 20:13:41 +02:00
guiapplauncher Move Weather Anchor Layout example to manual tests 2023-03-02 05:55:57 +01:00
network Rid of 'special case' markers 2023-04-13 18:30:58 +02:00
opengl tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
other Rid of 'special case' markers 2023-04-13 18:30:58 +02:00
printsupport tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
shared tests: remove PlatformInputContext::filterEvent() 2023-01-18 13:21:06 +01:00
sql SQL/Tests: make sure created procedures are cleaned up on exit 2023-04-15 13:56:21 +02:00
testlib Rid of 'special case' markers 2023-04-13 18:30:58 +02:00
tools Fix another warning when comparing size_t and qsizetype 2023-04-18 00:10:56 +02:00
wasm Support filter list for file input when opening a file on WASM 2023-03-07 12:50:41 +01:00
widgets tests: blacklist tst_QGraphicsEffect::draw() on Wayland 2023-04-17 16:05:24 +02:00
xml tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
network-settings.h Use SPDX license identifiers 2022-05-16 16:37:38 +02:00