Temp Trigger and Timer Functions Not Purged

Post Reply
Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Temp Trigger and Timer Functions Not Purged

Post by Jor'Mox »

So, I was poking around in the _G variable, and I noticed I had a HUGE number of items there called Timer# or Trigger#, which appear to be the functions executed when a timer or trigger with that id executes. However, most of these triggers and timers have since been killed, but the functions they execute remain. Is this intentional, even though there is no realistic way to access those functions for repeat use? If not, would it be feasible to remove these items as part of the functionality of the killTimer and killTrigger functions?

As a useful side note, a bit of testing revealed that when the id returned for a timer was 2, the resulting function stored for it was Timer2, with similar results for other numbers. So, in theory, you could just execute this:
Code: [show] | [select all] lua
_G["Timer"..timer_id] = nil
or
Code: [show] | [select all] lua
_G["Trigger"..trig_id] = nil
And it would purge the functions being stored, when the triggers or timers were deleted.

I don't know that it would make too much of a difference, but it should at least reduce memory requirements over time.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Temp Trigger and Timer Functions Not Purged

Post by Vadi »

I agree with you that they should be marked for deletion properly. I've filed the report here.

Post Reply