server: make sure that OnFrame() is never called after OnSessionClose()

This commit is contained in:
aler9
2021-05-16 21:30:13 +02:00
parent c6ff1e0d02
commit ea6138c282
2 changed files with 8 additions and 0 deletions

View File

@@ -332,6 +332,9 @@ func (ss *ServerSession) run() {
for sc := range ss.conns {
if sc == ss.tcpConn {
sc.Close()
// make sure that OnFrame() is never called after OnSessionClose()
<-sc.done
}
select {