What steps will reproduce the problem?
1. Register a timer to a callback which causes an error
2. Internal object representing the timer becomes orphaned inside activeTimers table.
What is the expected output? What do you see instead?
As far as I can tell, this causes no actual bugs (yet), except a very slight memory leak, since timer objects are never moved to inactiveTimers table.
What version of the product are you using?
Do you have an error log of what happened?
Please provide any additional information below.
In the OnFinished routine, the callback is called (without protected mode [x]pcall) before the cleanup routines. If this callback errors, these routines do not run. So the animation object is left in a finished state, but never moved to inactiveTimers to be re-used (and gets left in activeTimers). Future changes to the way the lib works may introduce a bug, because now a finished timer is still considered 'active'.
See this paste: http://codepad.org/FYMyxkMm
The correct solution is probably just to move the callback dispatch to the end of the function. That is, the timer object should be moved to inactiveTimers before the callback is run. Alternately, the callback should be dispatched in a protected fashion, like with pcall.
- 1 comment
- Last updated
- Sep 11, 2014
- Jul 25, 2014
- Declined - We decided not to take action on this ticket.
- Defect - A shortcoming, fault, or imperfection
- Medium - Normal priority.