358 - AceTimer-3.0: Timer objects may become orphaned

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?
Not applicable.

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:

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.

User When Change
Nevcairiel Sep 11, 2014 at 10:08 UTC Changed status from New to Declined
nefftd Jul 25, 2014 at 21:18 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 1 comment
  • Avatar of Nevcairiel Nevcairiel Sep 11, 2014 at 10:08 UTC - 0 likes

    The code in question will be re-written to use the C_Timer in 6.0, hence fixing this is kinda pointless at this time.

  • 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.

Reported by

Possible assignees