aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-09-18 01:21:49 +0800
committerFelix Lange <fjl@twurst.com>2015-09-18 01:21:49 +0800
commit69f48e468902ab4f1b96dba0e2f3c8f480772d2e (patch)
treeb32fa05439d05679956aeb6a6586a70d42e2394c
parent58fbcaa750aaa51d349ef28d98b58c9a0cfeee31 (diff)
parent2f65ddc50107399e867e28eca7e18ddd12b596c6 (diff)
downloaddexon-69f48e468902ab4f1b96dba0e2f3c8f480772d2e.tar
dexon-69f48e468902ab4f1b96dba0e2f3c8f480772d2e.tar.gz
dexon-69f48e468902ab4f1b96dba0e2f3c8f480772d2e.tar.bz2
dexon-69f48e468902ab4f1b96dba0e2f3c8f480772d2e.tar.lz
dexon-69f48e468902ab4f1b96dba0e2f3c8f480772d2e.tar.xz
dexon-69f48e468902ab4f1b96dba0e2f3c8f480772d2e.tar.zst
dexon-69f48e468902ab4f1b96dba0e2f3c8f480772d2e.zip
Merge pull request #1811 from bas-vk/timer-clearinterval
timer bugfix when clearInterval was called from within the callback
-rw-r--r--jsre/jsre.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/jsre/jsre.go b/jsre/jsre.go
index 0db9e33fc..af7d507c6 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)