diff --git a/receive_stream.go b/receive_stream.go index 9f06f21f..040e067c 100644 --- a/receive_stream.go +++ b/receive_stream.go @@ -132,6 +132,7 @@ func (s *receiveStream) readImpl(p []byte) (bool /*stream completed */, int, err } if deadlineTimer == nil { deadlineTimer = utils.NewTimer() + defer deadlineTimer.Stop() } deadlineTimer.Reset(deadline) } diff --git a/send_stream.go b/send_stream.go index 6c71f0b8..ba6e0a34 100644 --- a/send_stream.go +++ b/send_stream.go @@ -137,6 +137,7 @@ func (s *sendStream) Write(p []byte) (int, error) { } if deadlineTimer == nil { deadlineTimer = utils.NewTimer() + defer deadlineTimer.Stop() } deadlineTimer.Reset(deadline) }