Browse Source

Make background task handler Sendable

onevcat 1 month ago
parent
commit
56a431536f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Sources/Cache/ImageCache.swift

+ 1 - 1
Sources/Cache/ImageCache.swift

@@ -885,7 +885,7 @@ open class ImageCache: @unchecked Sendable {
 
         let taskState = BackgroundTaskState()
 
-        @MainActor @Sendable func endBackgroundTaskIfNeeded() {
+        let endBackgroundTaskIfNeeded: @MainActor @Sendable () -> Void = {
             Task { @MainActor in
                 guard let bgTask = await taskState.takeValidValueAndInvalidate() else { return }
                 guard let sharedApplication = KingfisherWrapper<UIApplication>.shared else { return }