-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
Description
Hey.
I just discovered an intersting case.
If timer is cleared from inside of its handler, _onDone/finished callback (which I assume is not even public...?) gets called twice, which in case of timers bound to groups removes last timer from its list of managed timers.
Line 42 in 501d6ab
| timers.splice(timers.indexOf(id), 1); |
indexOf on second call here returns -1 (since id has already been removed)Wrapping this call with simple
if to verify timer is still there seems to fix the problem, though, this should be properly handled in timer code - I'm not using intervals in my code, but it looks like interval cleared in its handler called after interval.resume() might get rescheduled as well. That would need a separate test, I guess...
Minimal testcase follows:
https://gist.github.com/81e656a7f06276081cf148283500c49e