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

[Trigger] the leaking group and locations

Status
Not open for further replies.
"things that leak" says that a leak can be prevented from group by declaring in with variable and then destroy it with
  • Custom script: call DestroyGroup(udg_units_around_caster)
Will it leak if I call this function 2.30 seconds later?

same for locations, I have point array with 4 locations
  • Custom script: Custom script: call RemoveLocation(udg_loc(1,2,3,4))
I jsut wonder about this leaking concept. So to not leak I must destroy these, does it matter when?
 
Will it leak if I call this function 2.30 seconds later?

It will if the variable is set to another value within that 2.3 seconds.

I jsut wonder about this leaking concept. So to not leak I must destroy these, does it matter when?

No, it doesn't matter when but be careful to not lose the reference.

Also arrays are defined like this

  • Custom script: call RemoveLocation(udg_loc[0])
 
Generally it does not matter when you free your memory again.

But you must ensure that you clean it before you overwrite the variable again.

So if you can 100% ensure you dont use this variable during your wait time you can clean it after, but if not you must clean if before the wait.

But anyway waiting like this is no good habit and you should avoid working like this, and also avoiding working with waits.
 
Status
Not open for further replies.
Top