1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 10:08:15 -05:00

Merge pull request #587 from ghv2/fix-timer-leak

fix timer leak
This commit is contained in:
DarienRaymond 2017-10-06 16:35:32 +02:00 committed by GitHub
commit 1dcf3aa74a

View File

@ -29,7 +29,9 @@ func (t *ActivityTimer) SetTimeout(timeout time.Duration) {
func (t *ActivityTimer) run() { func (t *ActivityTimer) run() {
ticker := time.NewTicker(<-t.timeout) ticker := time.NewTicker(<-t.timeout)
defer ticker.Stop() defer func() {
ticker.Stop()
}()
for { for {
select { select {