Tune some clean up code

This commit is contained in:
iamqizhao
2016-07-27 11:36:22 -07:00
parent 6732fdf9f8
commit f921887ab5

View File

@ -418,9 +418,7 @@ func (t *http2Client) CloseStream(s *Stream, err error) {
delete(t.activeStreams, s.id) delete(t.activeStreams, s.id)
if t.state == draining && len(t.activeStreams) == 0 { if t.state == draining && len(t.activeStreams) == 0 {
// The transport is draining and s is the last live stream on t. // The transport is draining and s is the last live stream on t.
t.mu.Unlock() defer t.Close()
t.Close()
return
} }
t.mu.Unlock() t.mu.Unlock()
if updateStreams { if updateStreams {