Skip to content
Permalink
Browse files
Merge pull request #91 from takewofly/bug/panic
Fix: taskPool will execute task when session was nil
  • Loading branch information
AlexStocks committed Jan 12, 2022
2 parents 76136d0 + d25d2a8 commit 292995d84c7b62fd510c2f64cd54d9e5e00ff290
Showing 1 changed file with 5 additions and 0 deletions.
@@ -565,6 +565,11 @@ func (s *session) run() {

func (s *session) addTask(pkg interface{}) {
f := func() {
s.lock.RLock()
defer s.lock.RUnlock()
if s.Connection == nil {
return
}
s.listener.OnMessage(s, pkg)
s.incReadPkgNum()
}

0 comments on commit 292995d

Please sign in to comment.