Fix EventSwitch usage in WaitForOneEvent

This commit is contained in:
Ethan Frey 2017-02-27 14:55:29 +01:00
parent d56cb2ab4b
commit 21501815dd
1 changed files with 2 additions and 3 deletions

View File

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