]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
Packet tunnel: Remove last error in the completion handler given to adapter.stop
authorAndrej Mihajlov <and@mullvad.net>
Wed, 2 Dec 2020 12:43:09 +0000 (13:43 +0100)
committerAndrej Mihajlov <and@mullvad.net>
Thu, 3 Dec 2020 12:22:52 +0000 (13:22 +0100)
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift

index 94dbbdd77ed5c0eb7d614d0df6a22d2fa9149103..28eb986fdf6a11af86f54f45af9353ff4b9fbd37 100644 (file)
@@ -77,11 +77,11 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
     }
 
     override func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) {
-        ErrorNotifier.removeLastErrorFile()
-
         wg_log(.info, staticMessage: "Stopping tunnel")
 
         adapter.stop { error in
+            ErrorNotifier.removeLastErrorFile()
+
             if let error = error {
                 wg_log(.error, message: "Failed to stop WireGuard adapter: \(error.localizedDescription)")
             }