diff options
| author | Emīls <emils@mullvad.net> | 2025-01-30 17:23:35 +0100 |
|---|---|---|
| committer | Emīls <emils@mullvad.net> | 2025-01-30 17:23:35 +0100 |
| commit | 1fde78ba244104e7eed4d0ad4c18fdf60131d443 (patch) | |
| tree | 353d249c88fbdd9d2c85c04f011f7c1b9dce33a3 | |
| parent | a07e80366e802164f96e12a4f22de5f0b565c996 (diff) | |
| parent | 6b829e7716209d84e5219f48917499669244a9b4 (diff) | |
| download | mullvadvpn-1fde78ba244104e7eed4d0ad4c18fdf60131d443.tar.xz mullvadvpn-1fde78ba244104e7eed4d0ad4c18fdf60131d443.zip | |
Merge branch 'background-task-still-crashing-ios-1048'
| -rw-r--r-- | ios/MullvadVPN/AppDelegate.swift | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ios/MullvadVPN/AppDelegate.swift b/ios/MullvadVPN/AppDelegate.swift index b1a8a9a256..47cae3a164 100644 --- a/ios/MullvadVPN/AppDelegate.swift +++ b/ios/MullvadVPN/AppDelegate.swift @@ -280,11 +280,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD using: .main ) { [self] task in - let handle = relayCacheTracker.updateRelays { result in + nonisolated(unsafe) let handle = relayCacheTracker.updateRelays { result in task.setTaskCompleted(success: result.isSuccess) } - task.expirationHandler = { + task.expirationHandler = { @Sendable in handle.cancel() } @@ -303,12 +303,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD forTaskWithIdentifier: BackgroundTask.privateKeyRotation.identifier, using: .main ) { [self] task in - let handle = tunnelManager.rotatePrivateKey { [self] error in + nonisolated(unsafe) let handle = tunnelManager.rotatePrivateKey { [self] error in scheduleKeyRotationTask() task.setTaskCompleted(success: error == nil) } - task.expirationHandler = { + task.expirationHandler = { @Sendable in handle.cancel() } } @@ -325,12 +325,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD forTaskWithIdentifier: BackgroundTask.addressCacheUpdate.identifier, using: .main ) { [self] task in - let handle = addressCacheTracker.updateEndpoints { [self] result in + nonisolated(unsafe) let handle = addressCacheTracker.updateEndpoints { [self] result in scheduleAddressCacheUpdateTask() task.setTaskCompleted(success: result.isSuccess) } - task.expirationHandler = { + task.expirationHandler = { @Sendable in handle.cancel() } } |
