diff options
| author | David Redondo <qt@david-redondo.de> | 2024-05-29 15:05:30 +0200 |
|---|---|---|
| committer | David Redondo <qt@david-redondo.de> | 2024-05-30 22:28:44 +0200 |
| commit | 1c2ff06654bf33dffbceaadcf777134a9121d5e4 (patch) | |
| tree | 37e1aa654014353168ce61dbc8b39593bea719c5 /src/qml/jsruntime/qv4function.cpp | |
| parent | d807fb50785aa4dc5a6392269928bbaae249da17 (diff) | |
DelegateModel: Fix crash when model changes during model reset
There are two issues here at play that interact to a crash. First is using
sender() inside the slot of a single shot connection. This doesn't work
reliably as inside doActivate the connection is removed before invoking
the slot. However QObject::sender() will look through all connections to
find one with the same sender as the currentSender otherwise it returns
nullptr. Which means as long as there are other connections to the same
object sender() would still work. This brings us to the second issue,
if the model changes between modelAboutToBeReset and modelReset, down
the line the signal from the old model would still be handled and
since there were no other connections to the old model anymore crash.
Pick-to: 6.7
Change-Id: I71af46ec691e0c130cf367ac9fa04308c0826481
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4function.cpp')
0 files changed, 0 insertions, 0 deletions
