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

Do integers/real and units leak?

Status
Not open for further replies.
Level 2
Joined
Jan 17, 2009
Messages
10
Do integers/real leak?
Do i have to set all integers/real into variables?
Do i remove them? if so how? or just set them as 0 in the end?

Do units leak?
If i create 1 dummy. do i have to store it into a variable?
do i have to remove the variable by setting [dummy = no unit]?
 
Level 7
Joined
Mar 8, 2009
Messages
360
Almost everything leaks, but integer,real,boolean (and string?) leaks are ignorable small.
Leaks are only significant if the type extends handle.

A unit "leaks" ofc, the computer has to memorise were it is, at least i hope it does. Remove the unt end the memory used for it is gone.

You should only null a unit(or any handle) variable when the handle ever gets destroyed. you don't need to put things in variables if you don't need the variables.
 
Level 8
Joined
Mar 26, 2009
Messages
301
Unit Variables leak i guess, not the unit itself. (Assuming you don't create a permanent dummy unit each time casting a spell) Unit Variable leak can be fixed by adding:
Set UnitVariable = No Units
to the end of trigger line. And there is jass style unit variable removal but i don't know the code. Correct me if i am wrong with anything above.
 
Unit Variables leak i guess, not the unit itself. (Assuming you don't create a permanent dummy unit each time casting a spell) Unit Variable leak can be fixed by adding:
Set UnitVariable = No Units
to the end of trigger line. And there is jass style unit variable removal but i don't know the code. Correct me if i am wrong with anything above.

I think you think the pointer of the global leaks, which it doesn't.

Though I don't know the exact details, globals may need to be set to null just as locals because the new patch may have brought that leak. But it's very minor and didn't exists in the earlier patches as far as we know.

More info can be found in this link ( http://www.thehelper.net/forums/showthread.php?t=136801 ).

And yes the unit itself leaks but the game automatically removes the unit once he has decayed. So no need to wory about unit leaks.
 
Level 8
Joined
Mar 26, 2009
Messages
301
I meant; if you don't kill the dummy after it performs its duty, it will remain on map and each time the spell is cast, a new dummy will be created and game will lag more and more over time. I have got a question; do undestroyed sounds cause leak? There is a Destroy Sound trigger line, should we use it after each sound play (including sounds from "Unit Transmission" triggers)
 
Some people need to learn reading here..

If you are referring to me then you are one of them.

I meant; if you don't kill the dummy after it performs its duty, it will remain on map and each time the spell is cast, a new dummy will be created and game will lag more and more over time.

Learn to recycle dummies. Or if it's too difficult for you (assuming your using GUI), simply remove the dummy once it's 'duties' are over.

Recycling dummies means re-using already created dummies.
 
Status
Not open for further replies.
Top