• 🏆 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!

Question about leaks

Status
Not open for further replies.
Level 2
Joined
Jan 17, 2009
Messages
10
I have a question about leaks.
If you set a variable for something like

Set Group = (Units within 500 of (Position Of Picked Unit))

The (Position Of Picked Unit) will leak, but will it leak if i store it within a variable, and then destroy it? I was wondering because the variable is set as a GROUP, not a POINT.

Do i have to set (Position Of Picked Unit) into another variable and then do something like this?

Set Group = (Unit within 500 of (Point))
 
Level 11
Joined
May 31, 2008
Messages
698
Any time where you call for a point and it isnt a variable that is later removed it will leak. Even when u do something like distance between points, which gets a real value, the points that you are getting will still leak unless you remove them.
 
Level 2
Joined
Jan 17, 2009
Messages
10
thanks
another question
if i have a few points and unit groups stored in variables, but i don't remove them immediately in the same trigger throughout the game until the end of the game, i then remove them in a different trigger. will it leak and cause lag too?

for example.
i want to store a certain group containing only heroes chosen by players.
therefore, everytime a player buys a hero, i added the hero to a group [unit group], then stored as a variable throughout until end of the game shall be removed
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
When the game ends, all leaks are removed as well as all game data. Leaks do not carry over from one game to another.

If you notice when very leaky maps end, the game often hangs for a few seconds or minutes while all allocated objects are destroyed, this is it clearing the game instance and all leaks which occured in it.

The problem with leaks is that in the game they occur it slows down the speed of some opperations as well as increasing the ammount of memory needed to play the game. The end product is lag (when the game takes ages to do a simple opperation) or a rediculous number of pagefaults making the game near unplayable or even crashes.
 
Status
Not open for further replies.
Top