path: root/src/imports
diff options
authorJ-P Nurmi <jpnurmi@qt.io>2017-01-27 09:45:22 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-01-27 10:39:56 +0000
commit0942e5cd6f1e4c8eac45a77c5deece671a6f513b (patch)
tree24d555aba6fab4e4ae4a057117afc78d08380cbc /src/imports
parent855e23ebd6691b03420b7f1621ea4185447cfd54 (diff)
QQuickScrollBarAttached: fix change listener removal
Before bb2a6c6 QQuickScrollBarAttached called flickable->updateOrAddGeometryChangeListener(Size) when attaching to a Flickable, and flickable->removeItemChangeListener(Geometry) when detaching from a Flickable. In bb2a6c6 the latter was changed to flickable->updateOrRemoveGeometryChangeListener(listener, Size) to make the attach and detach operations nice and symmetric. Now the problem is that updateOrRemoveGeometryChangeListener(Size) doesn't actually remove the listener, but just resets the geometry types it listens to. Thus, upon destruction of QQuickScrollBarAttached, it leaves behind a dangling pointer in Flickable's list of change listeners. We can call either of these to fix the problem: flickable->updateOrRemoveGeometryChangeListener(Nothing) flickable->removeItemChangeListener(Geometry) The former does essentially the latter with some extra overhead, so we'll just revert back to how it was before bb2a6c6. I added a warning note, also to ScrollIndicator since it's using the same approach, to avoid the same pitfall in the future. Change-Id: Ibdce15b22edf549491426d769b74b18daf0500ca Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports')
0 files changed, 0 insertions, 0 deletions