Skip to content

Commit 6b829e7

Browse files
committed
Use a sendable closure for task expiry
1 parent a07e803 commit 6b829e7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ios/MullvadVPN/AppDelegate.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
280280
using: .main
281281
) { [self] task in
282282

283-
let handle = relayCacheTracker.updateRelays { result in
283+
nonisolated(unsafe) let handle = relayCacheTracker.updateRelays { result in
284284
task.setTaskCompleted(success: result.isSuccess)
285285
}
286286

287-
task.expirationHandler = {
287+
task.expirationHandler = { @Sendable in
288288
handle.cancel()
289289
}
290290

@@ -303,12 +303,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
303303
forTaskWithIdentifier: BackgroundTask.privateKeyRotation.identifier,
304304
using: .main
305305
) { [self] task in
306-
let handle = tunnelManager.rotatePrivateKey { [self] error in
306+
nonisolated(unsafe) let handle = tunnelManager.rotatePrivateKey { [self] error in
307307
scheduleKeyRotationTask()
308308
task.setTaskCompleted(success: error == nil)
309309
}
310310

311-
task.expirationHandler = {
311+
task.expirationHandler = { @Sendable in
312312
handle.cancel()
313313
}
314314
}
@@ -325,12 +325,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
325325
forTaskWithIdentifier: BackgroundTask.addressCacheUpdate.identifier,
326326
using: .main
327327
) { [self] task in
328-
let handle = addressCacheTracker.updateEndpoints { [self] result in
328+
nonisolated(unsafe) let handle = addressCacheTracker.updateEndpoints { [self] result in
329329
scheduleAddressCacheUpdateTask()
330330
task.setTaskCompleted(success: result.isSuccess)
331331
}
332332

333-
task.expirationHandler = {
333+
task.expirationHandler = { @Sendable in
334334
handle.cancel()
335335
}
336336
}

0 commit comments

Comments
 (0)