fix: do not recover proxy on exit if proxy is set by other process
This commit is contained in:
parent
8f3cd2146b
commit
95154b3250
@ -133,7 +133,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
Logger.log("ClashX quit need clean proxy setting")
|
||||
shouldWait = true
|
||||
group.enter()
|
||||
SystemProxyManager.shared.disableProxy {
|
||||
|
||||
SystemProxyManager.shared.disableProxy(forceDisable: ConfigManager.shared.isProxySetByOtherVariable.value) {
|
||||
group.leave()
|
||||
}
|
||||
}
|
||||
|
@ -68,10 +68,10 @@ class SystemProxyManager: NSObject {
|
||||
})
|
||||
}
|
||||
|
||||
func disableProxy(complete: (() -> Void)? = nil) {
|
||||
func disableProxy(forceDisable: Bool = false, complete: (() -> Void)? = nil) {
|
||||
let port = ConfigManager.shared.currentConfig?.usedHttpPort ?? 0
|
||||
let socketPort = ConfigManager.shared.currentConfig?.usedSocksPort ?? 0
|
||||
SystemProxyManager.shared.disableProxy(port: port, socksPort: socketPort, complete: complete)
|
||||
SystemProxyManager.shared.disableProxy(port: port, socksPort: socketPort, forceDisable: forceDisable, complete: complete)
|
||||
}
|
||||
|
||||
func disableProxy(port: Int, socksPort: Int, forceDisable: Bool = false, complete: (() -> Void)? = nil) {
|
||||
|
Loading…
Reference in New Issue
Block a user