fix race condition on map operation

master
fangdingjun 6 years ago
parent e722eded24
commit ac31db180c

@ -352,11 +352,12 @@ func (c *Conn) Close() error {
s.Close() s.Close()
} }
c.lock.Lock()
for n := range c.streams { for n := range c.streams {
delete(c.streams, n) delete(c.streams, n)
} }
c.lock.Lock()
C.nghttp2_session_terminate_session(c.session, 0) C.nghttp2_session_terminate_session(c.session, 0)
C.nghttp2_session_del(c.session) C.nghttp2_session_del(c.session)
c.lock.Unlock() c.lock.Unlock()

Loading…
Cancel
Save