Skip to content
Permalink
Browse files
Fix: taskPool will execute task when session was nil
  • Loading branch information
Lvnszn committed Jan 11, 2022
1 parent 76136d0 commit d25d2a84625a364f5eb046f1de3497b553d9fd22
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 d25d2a8

Please sign in to comment.