Merge pull request #15 from robotn/fix-pr

Update End() function, Fixed close chan too fast
This commit is contained in:
vz 2020-05-31 10:13:25 -04:00 committed by GitHub
commit 5802a7a832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ import (
const ( const (
// Version get the gohook version // Version get the gohook version
Version = "v0.30.1.83, Sierra Nevada!" Version = "v0.30.2.88, Sierra Nevada!"
// HookEnabled honk enable status // HookEnabled honk enable status
HookEnabled = 1 // iota HookEnabled = 1 // iota
@ -244,6 +244,7 @@ func End() {
asyncon = false asyncon = false
C.endPoll() C.endPoll()
C.stop_event() C.stop_event()
time.Sleep(time.Millisecond * 10)
for len(ev) != 0 { for len(ev) != 0 {
<-ev <-ev