You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
case .asynchronous:
// Don't consider the subsamplingLevel when comparing the image native size with sizeForDrawing.
guard var size = frameSize(at: index) else {
return nil
}
if let sizeForDrawing = decodingOptions.sizeForDrawing {
// See which size is smaller: the image native size or the sizeForDrawing.
if sizeForDrawing.width * sizeForDrawing.height < size.width * size.height {
size = sizeForDrawing
}
}
options = imageSourceAsyncOptions(sizeForDrawing: size, subsamplingLevel: subsamplingLevel)
**image = CGImageSourceCreateThumbnailAtIndex(imageSource, index, options)**
...
I am getting an occasional crash here and it appears to occur when there is reloading images from the cache. If I felt more confident in my Swift, I'd wrap that bolded line in a DispatchQueue.main.async { } block as I think what is happening is that it's trying to update the UI from outside the main queue. Maybe?
In particular, it seems this code is running inside the DiskCache decode queue.
As with any async bug based on reloading junk from cache, this is a pain to actually make happen. But the most common scenario is when I am navigating from one view to a previously viewed view with a lot of images in it.
The text was updated successfully, but these errors were encountered:
Hey, thank you for reporting. This looks like thread explosion, what explains why you encounter it when there are many images. Which device/OS version you running?
I think there's a bug in here in ImageDecoder.swift:
...
case .asynchronous:
// Don't consider the subsamplingLevel when comparing the image native size with sizeForDrawing.
guard var size = frameSize(at: index) else {
return nil
}
...
I am getting an occasional crash here and it appears to occur when there is reloading images from the cache. If I felt more confident in my Swift, I'd wrap that bolded line in a DispatchQueue.main.async { } block as I think what is happening is that it's trying to update the UI from outside the main queue. Maybe?
In particular, it seems this code is running inside the DiskCache decode queue.
![Screen Shot 2021-04-22 at 19 39 27](https://user-images.githubusercontent.com/234614/115801608-c6c8a600-a3a2-11eb-8665-c4208e747ca4.png)
As with any async bug based on reloading junk from cache, this is a pain to actually make happen. But the most common scenario is when I am navigating from one view to a previously viewed view with a lot of images in it.
The text was updated successfully, but these errors were encountered: