aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoesis2017-08-28 15:00:06 +0800
committerjoesis2017-08-28 15:00:06 +0800
commit1698df20cadf507689bd091174b466e7c6c6876e (patch)
tree7bb33595a16c1a57b4454f014b48fc08e1ec2406
parent98b24bc00bf9f94d20a776253ee5086f2ae5b00c (diff)
downloadsystray-1698df20cadf507689bd091174b466e7c6c6876e.tar.bz2
remove unncessary temporary var
-rw-r--r--systray.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/systray.go b/systray.go
index 5ee6609..d4f86cc 100644
--- a/systray.go
+++ b/systray.go
@@ -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