From d45f052f168204b85de2f218ce87594c48ebd61a Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Tue, 27 Aug 2019 16:00:59 -0700 Subject: [PATCH] [AltStore] Fixes potential endless loading of remote images --- AltStore/App Detail/AppContentViewController.swift | 2 +- AltStore/Browse/BrowseCollectionViewCell.swift | 2 +- AltStore/Browse/BrowseViewController.swift | 2 +- AltStore/My Apps/MyAppsViewController.swift | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AltStore/App Detail/AppContentViewController.swift b/AltStore/App Detail/AppContentViewController.swift index 3bfb1e3c..33ddd9d5 100644 --- a/AltStore/App Detail/AppContentViewController.swift +++ b/AltStore/App Detail/AppContentViewController.swift @@ -136,7 +136,7 @@ private extension AppContentViewController dataSource.prefetchHandler = { (imageURL, indexPath, completionHandler) in return RSTAsyncBlockOperation() { (operation) in ImagePipeline.shared.loadImage(with: imageURL as URL, progress: nil, completion: { (response, error) in - guard !operation.isCancelled else { return } + guard !operation.isCancelled else { return operation.finish() } if let image = response?.image { diff --git a/AltStore/Browse/BrowseCollectionViewCell.swift b/AltStore/Browse/BrowseCollectionViewCell.swift index 52e64edc..b7a82521 100644 --- a/AltStore/Browse/BrowseCollectionViewCell.swift +++ b/AltStore/Browse/BrowseCollectionViewCell.swift @@ -69,7 +69,7 @@ private extension BrowseCollectionViewCell dataSource.prefetchHandler = { (imageURL, indexPath, completionHandler) in return RSTAsyncBlockOperation() { (operation) in ImagePipeline.shared.loadImage(with: imageURL as URL, progress: nil, completion: { (response, error) in - guard !operation.isCancelled else { return } + guard !operation.isCancelled else { return operation.finish() } if let image = response?.image { diff --git a/AltStore/Browse/BrowseViewController.swift b/AltStore/Browse/BrowseViewController.swift index 6d6ab679..cc8dec48 100644 --- a/AltStore/Browse/BrowseViewController.swift +++ b/AltStore/Browse/BrowseViewController.swift @@ -111,7 +111,7 @@ private extension BrowseViewController return RSTAsyncBlockOperation() { (operation) in ImagePipeline.shared.loadImage(with: iconURL, progress: nil, completion: { (response, error) in - guard !operation.isCancelled else { return } + guard !operation.isCancelled else { return operation.finish() } if let image = response?.image { diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index 177c2ae0..7e2641c6 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -190,7 +190,7 @@ private extension MyAppsViewController return RSTAsyncBlockOperation() { (operation) in ImagePipeline.shared.loadImage(with: iconURL, progress: nil, completion: { (response, error) in - guard !operation.isCancelled else { return } + guard !operation.isCancelled else { return operation.finish() } if let image = response?.image {