From 530b773dfcd2dddeb824cb2a2c7fe1778e5c7985 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 14 Jun 2012 15:11:54 +1000 Subject: Fix crash when dragging items outside visible area. If asynchronous item creation finishes while the content area of a ListView has been dragged full outside the visible area a full refill is triggered which can overwrite the requested index and potentially result in a single delegate item being assigned to multiple view items and later being doubly released. Only create the view item object in the createItem function to prevent this from happening. Secondly only reset the visible items if jumping outside the buffer range rather than just the fill range to prevent churn when the list only contains buffered items. Task-number: QTBUG-26232 Change-Id: I5bce845898ef5f699f34afc268594ef38e01d6a3 Reviewed-by: Martin Jones --- src/quick/items/qquickitemview_p_p.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/quick/items/qquickitemview_p_p.h') diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h index f68baf20f2..b580181c15 100644 --- a/src/quick/items/qquickitemview_p_p.h +++ b/src/quick/items/qquickitemview_p_p.h @@ -264,7 +264,6 @@ public: FxViewItem *trackedItem; QHash unrequestedItems; int requestedIndex; - FxViewItem *requestedItem; QQuickItemViewChangeSet currentChanges; QQuickItemViewChangeSet bufferedChanges; QPauseAnimationJob bufferPause; @@ -305,7 +304,6 @@ public: bool highlightRangeEndValid : 1; bool fillCacheBuffer : 1; bool inRequest : 1; - bool requestedAsync : 1; bool runDelayedRemoveTransition : 1; protected: @@ -331,7 +329,7 @@ protected: virtual void setPosition(qreal pos) = 0; virtual void fixupPosition() = 0; - virtual bool addVisibleItems(qreal fillFrom, qreal fillTo, bool doBuffer) = 0; + virtual bool addVisibleItems(qreal fillFrom, qreal fillTo, qreal bufferFrom, qreal bufferTo, bool doBuffer) = 0; virtual bool removeNonVisibleItems(qreal bufferFrom, qreal bufferTo) = 0; virtual void visibleItemsChanged() {} -- cgit v1.2.3