ASCollectionView icon indicating copy to clipboard operation
ASCollectionView copied to clipboard

Crash in prefetcher

Open paulfreeman opened this issue 5 years ago • 0 comments

Describe the bug When scrolling the PhotoView in the demo app the app crashed in the prefetcher call to the onCell prefetch method.

Crash occurred on onCellEvent?(.prefetchForData(data: dataToPrefetch)) in ASSectionDataSource

The call is on the background thread

	func prefetch(_ indexPaths: [IndexPath])
	{
		let dataToPrefetch: [Data] = indexPaths.compactMap
		{
			data[safe: $0.item]
		}
       onCellEvent?(.prefetchForData(data: dataToPrefetch)) 
	}

To Reproduce Run the demo app, rapidly scroll through photo content until the crash occurs. (I had been testing the memory by going in and out of the AppStore Layout view repeatedly prior to this).

ASCollectionView version Latest master (1.7)

Xcode Version: 12.1.1

Simulator, Device, Both? iPhone 12 pro Max, iOS 14.1

paulfreeman avatar Dec 02 '20 15:12 paulfreeman