fix timer leak

pull/587/head
ghv2 2017-10-06 15:42:46 +08:00
parent b862365832
commit 0ef745dbf9
1 changed files with 3 additions and 1 deletions

View File

@ -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 {