Переглянути джерело

streamline start-/stop-io

B. Petersen 5 роки тому
батько
коміт
432e7be400
2 змінених файлів з 4 додано та 6 видалено
  1. 3 5
      DcCore/DcCore/DC/Wrapper.swift
  2. 1 1
      deltachat-ios/AppDelegate.swift

+ 3 - 5
DcCore/DcCore/DC/Wrapper.swift

@@ -196,15 +196,13 @@ public class DcContext {
     }
 
     public func maybeStartIo() {
-        if dc_is_io_running(contextPointer) == 0 {
+        if isConfigured() {
             dc_start_io(contextPointer)
         }
     }
 
-    public func maybeStopIo() {
-        if dc_is_io_running(contextPointer) != 0 {
-            dc_stop_io(contextPointer)
-        }
+    public func stopIo() {
+        dc_stop_io(contextPointer)
     }
 
     public func performSmtpJobs() {

+ 1 - 1
deltachat-ios/AppDelegate.swift

@@ -210,7 +210,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
 
     func stopThreads() {
         state = .background
-        dcContext.maybeStopIo()
+        dcContext.stopIo()
     }
 
     // MARK: - BackgroundTask