aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/macOS/AppDelegate.swift6
1 files changed, 6 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
index 76ac000..5546eef 100644
--- a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
+++ b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
@@ -40,6 +40,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
self.statusItemController = statusItemController
}
}
+
+ func applicationWillTerminate(_ notification: Notification) {
+ if let currentTunnel = tunnelsTracker?.currentTunnel {
+ tunnelsManager?.startDeactivation(of: currentTunnel)
+ }
+ }
}
extension AppDelegate: StatusMenuWindowDelegate {