Update End() function, Fixed close chan too fast

This commit is contained in:
vcaesar 2020-05-31 10:11:43 -04:00
parent a945300efa
commit e29fdb45c2

View File

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