diff options
author | Ghanan Gowripalan <ghanan@google.com> | 2020-06-18 00:08:55 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-06-18 00:10:05 -0700 |
commit | 09b2fca40c61f9ec8d6745f422f6f45b399e8f94 (patch) | |
tree | bad9cde915e97298ee7d5f099e8d24f60b6eec5a /pkg/tcpip/transport/tcp/timer.go | |
parent | 6e0c170522279ca72119b17c41e2e1dc93c49d6a (diff) |
Cleanup tcp.timer and tcpip.Route
When a tcp.timer or tcpip.Route is no longer used, clean up its
resources so that unused memory may be released.
PiperOrigin-RevId: 317046582
Diffstat (limited to 'pkg/tcpip/transport/tcp/timer.go')
-rw-r--r-- | pkg/tcpip/transport/tcp/timer.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/tcp/timer.go b/pkg/tcpip/transport/tcp/timer.go index c70525f27..7981d469b 100644 --- a/pkg/tcpip/transport/tcp/timer.go +++ b/pkg/tcpip/transport/tcp/timer.go @@ -85,6 +85,7 @@ func (t *timer) init(w *sleep.Waker) { // cleanup frees all resources associated with the timer. func (t *timer) cleanup() { t.timer.Stop() + *t = timer{} } // checkExpiration checks if the given timer has actually expired, it should be |