mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 10:37:33 -07:00
the quest for leaks is over.
Why a singleton doesn't leak, vs calling static methods on a class is beyond me
This commit is contained in:
parent
78e5a00a68
commit
f54d5e9e8f
6 changed files with 36 additions and 37 deletions
|
@ -87,6 +87,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
|
|||
}
|
||||
|
||||
monitor.updateNetworkInfo()
|
||||
monitor.start()
|
||||
}
|
||||
|
||||
func applicationWillTerminate(aNotification: NSNotification) {
|
||||
|
@ -243,10 +244,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
|
|||
let id = String(network.nwid, radix: 16)
|
||||
|
||||
if network.connected {
|
||||
ServiceCom.leaveNetwork(id)
|
||||
ServiceCom.sharedInstance.leaveNetwork(id)
|
||||
}
|
||||
else {
|
||||
ServiceCom.joinNetwork(id)
|
||||
ServiceCom.sharedInstance.joinNetwork(id)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -257,11 +258,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
|
|||
}
|
||||
|
||||
func menuWillOpen(menu: NSMenu) {
|
||||
monitor.start()
|
||||
//monitor.updateNetworkInfo()
|
||||
}
|
||||
|
||||
func menuDidClose(menu: NSMenu) {
|
||||
monitor.stop()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue