• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Fixing Leaks

Status
Not open for further replies.
Level 7
Joined
May 16, 2004
Messages
355
Alright I understand what a leak is and such, but I need to know every type of leak and the proper way to deal with them using custom scripts. Also I need to know how they are created. And lastly I have a question regarding position leaks, does referencing to the Target Point and such leave a leak and when i create a dummy they need to have their position destroyed right?
 
Only one which ever bothers me is the location one. If you ever define a Point on the map just make sure you remove it. Most of the time I use other things such as regions or positions of units rather then Points. Im interested to see what some experienced map makers have to say on this though.
 
Komodo said:
Only one which ever bothers me is the location one. If you ever define a Point on the map just make sure you remove it. Most of the time I use other things such as regions or positions of units rather then Points. Im interested to see what some experienced map makers have to say on this though.

position of a unit IS a point.

and cant you just null all the variables in a function after using it?
 
I don't think nullifying is necessary, just destroying.

To answer the OP

Point: make a point variable

example trigger
set tempPoint = random point in region 001
create unit at tempPoint
custom script - call RemoveLocation(udg_tempPoint)

Unit group: make a unit group variable

example trigger
set tempGroup = units in region 001
pick every unit in tempGroup and do kill picked unit
custom script - call DestroyGroup(udg_tempGroup)

Groups leak when you use "pick every unit" action. Those are the only 2 types of leaks that you need to worry about.
 
if you destroy before nullifying, then it wont be nulled and the variable would still exist there.
 
I wanted to open a topic like that, but i saw it already exists, so i want to ask a few questions about leak.

You all say, i can prevent a leak by destroying the location. That makes sense in case of spells, where the location is always different.
But, what a bout locations that i will use later? So i have a periodic trigger that spawns units (AoS map) every x seconds to a location variable that always remains the same. I did not notice any leaks after hours of playing (probably because i have a lot of memory in my comp.), and i don't know why it is necessary to remove this location and then create it again every time the trigger runs.

Perhaps i don't understand well enough what makes a variable to leak.
 
Status
Not open for further replies.
Back
Top