Skip to content

Commit

Permalink
Update ImageDecoderTests
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Nov 17, 2024
1 parent 4e0bca9 commit a03251e
Show file tree
Hide file tree
Showing 2 changed files with 146 additions and 141 deletions.
6 changes: 3 additions & 3 deletions Sources/Nuke/Caching/Cache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ final class Cache<Key: Hashable, Value>: @unchecked Sendable {
self.memoryPressure.resume()

#if os(iOS) || os(tvOS) || os(visionOS)
Task {
await registerForEnterBackground()
Task { @MainActor in
registerForEnterBackground()
}
#endif
}
Expand All @@ -70,7 +70,7 @@ final class Cache<Key: Hashable, Value>: @unchecked Sendable {
}

#if os(iOS) || os(tvOS) || os(visionOS)
@MainActor private func registerForEnterBackground() {
private func registerForEnterBackground() {
notificationObserver = NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: nil) { [weak self] _ in
self?.clearCacheOnEnterBackground()
}
Expand Down
Loading

0 comments on commit a03251e

Please sign in to comment.