Procházet zdrojové kódy

make sure, pending backgroundTask is ended before recreated

B. Petersen před 4 roky
rodič
revize
87f7a72df3
1 změnil soubory, kde provedl 1 přidání a 0 odebrání
  1. 1 0
      deltachat-ios/AppDelegate.swift

+ 1 - 0
deltachat-ios/AppDelegate.swift

@@ -178,6 +178,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     private func registerBackgroundTask() {
         logger.info("⬅️ registering background task")
         bgIoTimestamp = Double(Date().timeIntervalSince1970)
+        unregisterBackgroundTask()
         backgroundTask = UIApplication.shared.beginBackgroundTask { [weak self] in
             // usually, the background thread is finished before in maybeStop()
             logger.info("⬅️ background expirationHandler called")