From 32f8c03270eecf66182a294ec7117a1c24f05155 Mon Sep 17 00:00:00 2001 From: Chris Rhodes Date: Fri, 19 Feb 2016 11:25:46 -0800 Subject: [PATCH] Fix a Lock instead of RLock in initialize. --- discord.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/discord.go b/discord.go index 0e439e1..9a6da40 100644 --- a/discord.go +++ b/discord.go @@ -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()