Capture task to ensure it doesn't get deallocated

This commit is contained in:
Maurice Parker
2019-12-06 15:47:25 -07:00
parent 9471287db2
commit 1e05238c54

View File

@@ -347,7 +347,7 @@ private extension AppDelegate {
os_log("Woken to perform account refresh.", log: self.log, type: .info)
DispatchQueue.main.async { [weak task] in
DispatchQueue.main.async {
if AccountManager.shared.isSuspended {
AccountManager.shared.resumeAll()
}
@@ -355,7 +355,7 @@ private extension AppDelegate {
if !AccountManager.shared.isSuspended {
self.suspendApplication()
os_log("Account refresh operation completed.", log: self.log, type: .info)
task?.setTaskCompleted(success: true)
task.setTaskCompleted(success: true)
}
}
}