Эх сурвалжийг харах

streamline start-/stop-io

B. Petersen 5 жил өмнө
parent
commit
432e7be400

+ 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