• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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