• 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] Trigger Help

Status
Not open for further replies.
Level 9
Joined
Jan 23, 2008
Messages
384
  • Heroes
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set Victim = (Dying unit)
      • Set Killer = (Killing unit)
      • Set V_player = (Owner of Victim)
      • Set K_player = (Owner of Killer)
      • Game - Display to (All players) the text: ((Name of V_player) + ( has been killed by + ((Name of K_player) + and for that he has earned 500 gold.)))
      • Player - Set K_player Current gold to ((K_player Current gold) + 500)
      • Set Victim = No unit
      • Set Killer = No unit
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
  • Heroes
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set Victim = (Dying unit)
      • Set Killer = (Killing unit)
      • Set V_player = (Owner of Victim)
      • Set K_player = (Owner of Killer)
      • Game - Display to (All players) the text: ((Name of V_player) + ( has been killed by + ((Name of K_player) + and for that he has earned 500 gold.)))
      • Player - Set K_player Current gold to ((K_player Current gold) + 500)
      • Set Victim = No unit
      • Set Killer = No unit

You don't need to store all those units, they do not leak.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Globals that are used more than once do not leak. . .
It is only locals that you have to worry about nulling.

Yes they might mean that a handle index is not recycled for quite some time, but if it gets used again it will eventually be recycled. The problem is with local handles as they dissapear after the function finishes executing its code and so can leak permantly if you do not set them to null.
 
Status
Not open for further replies.
Top