From f921887ab5c08d234a3e38d95e919b2e609c120f Mon Sep 17 00:00:00 2001 From: iamqizhao Date: Wed, 27 Jul 2016 11:36:22 -0700 Subject: [PATCH] Tune some clean up code --- transport/http2_client.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/transport/http2_client.go b/transport/http2_client.go index 51cf1792..036da819 100644 --- a/transport/http2_client.go +++ b/transport/http2_client.go @@ -418,9 +418,7 @@ func (t *http2Client) CloseStream(s *Stream, err error) { delete(t.activeStreams, s.id) if t.state == draining && len(t.activeStreams) == 0 { // The transport is draining and s is the last live stream on t. - t.mu.Unlock() - t.Close() - return + defer t.Close() } t.mu.Unlock() if updateStreams {