diff options
| author | joesis | 2017-08-28 15:00:06 +0800 |
|---|---|---|
| committer | joesis | 2017-08-28 15:00:06 +0800 |
| commit | 1698df20cadf507689bd091174b466e7c6c6876e (patch) | |
| tree | 7bb33595a16c1a57b4454f014b48fc08e1ec2406 | |
| parent | 98b24bc00bf9f94d20a776253ee5086f2ae5b00c (diff) | |
| download | systray-1698df20cadf507689bd091174b466e7c6c6876e.tar.bz2 | |
remove unncessary temporary var
| -rw-r--r-- | systray.go | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -52,20 +52,18 @@ func Run(onReady func(), onExit func()) { runtime.LockOSThread() if onReady == nil { - onReady = func() {} + systrayReady = func() {} } else { // Run onReady on separate goroutine to avoid blocking event loop - origOnReady := onReady readyCh := make(chan interface{}) go func() { <-readyCh - origOnReady() + onReady() }() - onReady = func() { + systrayReady = func() { close(readyCh) } } - systrayReady = onReady // unlike onReady, onExit runs in the event loop to make sure it has time to // finish before the process terminates |
