Browse Source

Fix EventSwitch usage in WaitForOneEvent

pull/424/head
Ethan Frey 8 years ago
parent
commit
21501815dd
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      rpc/client/helpers.go

+ 2
- 3
rpc/client/helpers.go View File

@ -72,9 +72,8 @@ func WaitForOneEvent(evsw types.EventSwitch,
evts <- data
})
// make sure to unregister after the test is over
// TODO: why doesn't the other call work???
// defer evsw.RemoveListenerForEvent(listener, evtTyp)
defer evsw.RemoveListener(listener)
defer evsw.RemoveListenerForEvent(evtTyp, listener)
// defer evsw.RemoveListener(listener) // this also works
select {
case <-quit:


Loading…
Cancel
Save