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

Am i making leaks?

Status
Not open for further replies.
Level 9
Joined
Aug 27, 2009
Messages
473
Level 4
Joined
Mar 5, 2006
Messages
46
I said i already have the locations leakless. I just want to know if using a variable that is not temporary needs to be cleaned. Because "Attackers" unit group variable is none temporary. It is a group of units in a Wave that needs to be ordered to attack a region every 10 seconds. If i destroy Attackers i will lose control over the units.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
I said i already have the locations leakless. I just want to know if using a variable that is not temporary needs to be cleaned. Because "Attackers" unit group variable is none temporary. It is a group of units in a Wave that needs to be ordered to attack a region every 10 seconds. If i destroy Attackers i will lose control over the units.

Making them attack in the begining won't do anything in the future, they will head at the point where the order (attack) is given and attack. Then you don't need the veriable for the specified group anymore.
 
Level 6
Joined
May 19, 2004
Messages
267
If you're gonna re-use the group, don't destroy it. If it's you're using it temporarily, destroy it.

Most of the times:
  • Actions
    • Unit Group - Pick every unit in Attackers and do (Actions)
      • Loop - Actions
        • Do stuff
Or;
  • Actions
    • Set Attackers = (Units in (Playable map area))
    • Unit Group - Pick every unit in Attackers and do (Actions)
      • Loop - Actions
        • Do stuff
    • Custom script: call DestroyGroup(udg_Attackers)
 
Status
Not open for further replies.
Top