diff options
author | Olivier De Cannière <olivier.decanniere@qt.io> | 2023-03-22 13:01:24 +0100 |
---|---|---|
committer | Olivier De Cannière <olivier.decanniere@qt.io> | 2023-03-27 13:52:34 +0200 |
commit | c534d6b7b0682d06225e3d801e72f5931b0c504e (patch) | |
tree | 7990ff0487316ad6715b3125894fab276b0fca6e /src/quick/items/qquickitem.cpp | |
parent | 05ae4d743b76aff4cc1a1c3d5aebc96e9f16f662 (diff) |
QV4: Mark singletons as deleted before actually deleting them
In cases where a singleton A holds a reference to another singleton B at
the end of the program and if B is destroyed before A, then the update
from B's destruction updates any binding A has on B. If the binding
tries to access B's members then "TypeError: Cannot read property
<property_name> of null" happens.
This fix marks all singletons as deleted before actually deleting them
so that bindings targeting them won't be reevaluated on update.
Randomness, likely due to a random seed in the QHash holding the
singletons changes the order of destruction of the singletons making the
issue sporadic. To account for this in the accompanying test, both
singletons hold a reference to the other.
Pick-to: 6.5
Fixes: QTBUG-111918
Change-Id: I30450fa08f89f7686c4a41fa46dde2174ce83606
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
0 files changed, 0 insertions, 0 deletions