From 2f65ddc50107399e867e28eca7e18ddd12b596c6 Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Wed, 16 Sep 2015 11:57:33 +0200 Subject: [PATCH] jsre: timer bugfix when clearInterval was called from within the callback --- jsre/jsre.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jsre/jsre.go b/jsre/jsre.go index 0db9e33fc5..af7d507c6d 100644 --- a/jsre/jsre.go +++ b/jsre/jsre.go @@ -154,7 +154,9 @@ loop: if err != nil { fmt.Println("js error:", err, arguments) } - if timer.interval { + + _, inreg := registry[timer] // when clearInterval is called from within the callback don't reset it + if timer.interval && inreg { timer.timer.Reset(timer.duration) } else { delete(registry, timer)