Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rinsuki committed Apr 27, 2022
1 parent 4badfa5 commit ad09af4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/Core/ImageCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public extension UIImageView {
func loadImage(from url: URL?, callback: (() -> Void)? = nil) {
guard let url = url as? NSURL else {
NSLog("overwrite image with URL nil")
image = nil
uiImageViewLastLoadingURL.removeObject(forKey: self)
if let oldOne = uiImageViewCancelToken.object(forKey: self) {
oldOne.cancel()
Expand All @@ -51,6 +52,7 @@ public extension UIImageView {
if let oldOne = uiImageViewCancelToken.object(forKey: self) {
oldOne.cancel()
}
image = nil
let cancellable = SDWebImageManager.shared.loadImage(with: url as URL, options: [], progress: nil) { [weak self] image, _, _, _, _, _ in
guard let self = self else {
return
Expand Down

0 comments on commit ad09af4

Please sign in to comment.