| 05-12-2006, 12:39 PM | #2 |
When you create a group variable, wc3 makes sure that it is set to a new, empty group at map init. I don't see anything that should leak here, as you just add and remove units from already existing groups. If you destroy the player groups, you can use them again IF you use them with a function that creates a new group that it returns, but you can't add/remove units to them without ensuring that there is a working player group. |
| 05-12-2006, 12:45 PM | #3 |
You have 2 location leaks: (Center of Top Center <gen>) that are never removed In fact, they are not just 2 leaks, since they are inside of loops they are much more |
| 05-12-2006, 12:55 PM | #4 | ||
Quote:
Thanks, that clears things up a bit. Quote:
That also clears up an unasked question. I was confused if you order a unit to a point as opposed to creating a unit at a point, that it would leak or not. But of course, the point leaks not the unit. |
| 05-13-2006, 04:02 PM | #5 | |
Quote:
Well, isn't he just pointing to the center of the rect? If he is, then there should be no problem because it will just use the same point over and over. Please correct me if I'm wrong.. - Soultaker |
| 05-13-2006, 04:10 PM | #6 |
yes, you are wrong. points are just a pair of real x and y variables So these functions create one of these pairs. And they behave like pointers. You can even use MoveLocation(loc,newx,newy) to change the values of both variables. Because of these 2 locations created by the same function with same arguments are 2 different objects, both may represent the same point but they are different portions of memory |
| 05-13-2006, 04:11 PM | #7 |
No, it is a new point everytime, even though it is at the same position. |
