SwiftQueue
SwiftQueue copied to clipboard
Fixed multiple calls to operation.run() by network monitor when turning airplane mode off.
There was a memory retain cycle that was fixed by making monitor and operation weak and using dispatchQueue.async. Even with retain cycle fixed when networkType == .cellular, turning airplane off causes two satisfied network condition calls for both cellular and WiFi. Checking if pathUpdateHandler is nil prevents both of them triggering.