aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/draganddrop
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2019-02-19 19:45:36 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2019-02-26 11:09:45 +0000
commit6618e4aed563c99c03904c9cf1e6e272d05315e3 (patch)
tree4cf2e508e6e9659c4c2c449efa5ac2fcb2b7bd2c /examples/quick/draganddrop
parentea17082234d9921c1fdf34a1f34fa28eeb7faf88 (diff)
Don't crash when passive grabber deleted before exclusive gr. released
In this scenario, a DragHandler is inside an Item in a Loader, under a MouseArea, which unloads the loader on press. So on press, the DragHandler acquires a passive grab, then the MouseArea acquires the exclusive grab, then the DragHandler is destroyed along with its parent when the Loader is unloaded. On release, QQuickEventPoint::setGrabberItem(nullptr) was sending an onGrabChanged(passiveGrabber, OverrideGrabPassive, this) notification. That was questionable: the handler was not just then getting its grab overridden, but rather un-overridden, because the exclusive grab was being released. It's also a good idea to check for null pointers, since m_passiveGrabbers is a collection of QPointers already, so we can tell when a passive grabber is deleted dynamically. It can also be reproduced with MultiPointTouchArea just as with MouseArea, so the test is written that way for convenience, because we have tst_multipointtoucharea_interop already. It doesn't really matter which handler has the passive grab, or which item has the exclusive grab that's being relinquished. Fixes: QTBUG-73819 Change-Id: Ic605efa2143a1d849be095dcb88d6c38d7d2ee19 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'examples/quick/draganddrop')
0 files changed, 0 insertions, 0 deletions