Fix a Lock instead of RLock in initialize.

This commit is contained in:
Chris Rhodes 2016-02-19 11:25:46 -08:00
parent e0010ab0ba
commit 32f8c03270

View file

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