Browse Source

Make background task handler Sendable

onevcat 1 tháng trước cách đây
mục cha
commit
56a431536f
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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 }