To understand leaks we'll first have to clarify some stuff:Ok so let's say i pick up some units and put it into tempGroup. So then i can say Pick up every unit in tempGroup and do crap, which will not cause a memory leak (allegedly...). Word on the street is that you use custom script to burn that variable to the ground and never see it again. And when you want another temporary group, you store the new units into the group.
What I'm asking is that is it necessary to manually remove the variable, since overwriting it would naturally destroy it. Or rather, doesn't tempGroup always point to the same exact spot in memory throughout the game?
Edit: And yea, all i need is to verify kingkingyyk3's technique.
Overwriting a variable of a type that points somewhere will only result in a new pointer. The object in the memory that the variable used to point to is still allocated in the memory, and since we overwritten the variable with a new pointer we have no chance of destroying said object. We've created a leak.
*Correct.As I understood it, a certain amount of memory is given to a pre-specified variable* and that block of memory would hold a changable value. Are you saying that every time a variable is stored, it goes to a different place (or that changing the value of the variable actually means pointing to a different loacation in memory)?**
You have to destroy group if you don't plan using it anymore.
Because in the future (multiplayer game) it will generate lots of lag if you do not clean up your leaks.
Read this if you want to learn more about Memory Leaks and Custom Script Guide;
http://www.thehelper.net/forums/showthread.php?t=27219&highlight=leaks
This is just not true, a lot of people have become leak nazi's but they overstate things a bit, you can get over 500K leaks with no visable lag, you wqill notice the leaks when the game is over and it takes forever to close the map, but it is only certain types of leaks that will cause lag, and even then not always.
To put this simple if your map is going to be played and won in under 20 to 25 minutes don't bother removeing leaks, you wont notice them. 25 to 30 minutes just remove the constant leaks, any thing more then 35 then you will want to remove as many as you can.