From 0ef745dbf9b763a501330db9cce44a2f6c6727a9 Mon Sep 17 00:00:00 2001 From: ghv2 Date: Fri, 6 Oct 2017 15:42:46 +0800 Subject: [PATCH] fix timer leak --- common/signal/timer.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/signal/timer.go b/common/signal/timer.go index e33a43fba..21837027c 100644 --- a/common/signal/timer.go +++ b/common/signal/timer.go @@ -29,7 +29,9 @@ func (t *ActivityTimer) SetTimeout(timeout time.Duration) { func (t *ActivityTimer) run() { ticker := time.NewTicker(<-t.timeout) - defer ticker.Stop() + defer func() { + ticker.Stop() + }() for { select {