Merge pull request #122 from iopred/patch-2

Fix a Lock instead of RLock in initialize.
This commit is contained in:
Bruce 2016-02-19 13:34:44 -06:00
commit bb612a0e8b

View file

@ -177,12 +177,14 @@ func (s *Session) handle(event interface{}) {
// initialize adds all internal handlers and state tracking handlers. // initialize adds all internal handlers and state tracking handlers.
func (s *Session) initialize() { func (s *Session) initialize() {
s.Lock() s.RLock()
if s.handlers != nil { if s.handlers != nil {
s.Unlock() s.RUnlock()
return return
} }
s.RUnlock()
s.Lock()
s.handlers = map[interface{}][]reflect.Value{} s.handlers = map[interface{}][]reflect.Value{}
s.Unlock() s.Unlock()