Fixed foreign events.

This commit is contained in:
Pietro Gagliardi 2014-08-18 17:19:56 -04:00
parent a8da22272f
commit b6bf7402ab
1 changed files with 0 additions and 4 deletions

View File

@ -146,8 +146,6 @@ func NewForeignEvent(channel interface{}, handler func(data interface{})) *Forei
}
func (fe *ForeignEvent) do() {
wait := make(chan struct{})
defer close(wait)
for {
v, ok := fe.c.Recv()
if !ok {
@ -156,9 +154,7 @@ func (fe *ForeignEvent) do() {
fe.d = v.Interface()
Do(func() {
fe.e.fire()
wait <- struct{}{}
})
<-wait
}
}