• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Do I need to destroy periodic timer

Status
Not open for further replies.
Level 2
Joined
Jun 25, 2019
Messages
5
Hello all,
if I have following code

Code:
TimerStart(CreateTimer(), 5.0, false, function()
    DestroyTimer(GetExpiredTimer())
    --some code
end)

do I need to call DestroyTimer explicitly if the timer is not periodic ?
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
According to this post here [Leak] Lua Scripting & Memory Leak:

Lua currently does not garbage collection Warcraft III object types like location, group and force. These still must be explicitly destroyed.

Yes you need to (unless I misunderstood). But it is possible things have changed since that post, someone with knowledge about W3's Lua might give you a more accurate answer.
 
Status
Not open for further replies.
Top