diff options
author | Felix Lange <fjl@twurst.com> | 2015-09-18 01:21:49 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-09-18 01:21:49 +0800 |
commit | 69f48e468902ab4f1b96dba0e2f3c8f480772d2e (patch) | |
tree | b32fa05439d05679956aeb6a6586a70d42e2394c | |
parent | 58fbcaa750aaa51d349ef28d98b58c9a0cfeee31 (diff) | |
parent | 2f65ddc50107399e867e28eca7e18ddd12b596c6 (diff) | |
download | dexon-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.go | 4 |
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) |