| 08-07-2006, 02:36 PM | #1 |
I got a bit confused there. If you have a local handle variable, you would have to (destroy/remove) and nullify it, in order to prevent leak. Like, if you want to make a location variable, you would have to Remove it and nullify it. But what would happen if I don't even have a variable, and only use something like JASS:GetUnitLoc(unit_x) |
| 08-07-2006, 02:54 PM | #2 |
The location is still there, just now you have no means to remove it since it's not a variable. Notably, this is why the location leaks in the BJ unit creations are so bad. |
| 08-07-2006, 03:29 PM | #3 |
Is location actually the only type which would leak like that? For example, maybe rects too? Or effects... JASS:DestroyEffect(AddSpecialEffect....) |
| 08-07-2006, 04:03 PM | #4 |
Take a guess |
| 08-07-2006, 04:05 PM | #5 |
Yeah, they all leak like that in case you didn't figure it out. Notably -- JASS:call DestroyEffect(AddSpecialEffect(...)) JASS:call RemoveLocation(GetUnitLoc(...)) |
| 08-07-2006, 04:18 PM | #6 |
Er, so JASS:call DestroyEffect(AddSpecialEffect(...)) call RemoveLocation(GetUnitLoc(...)) |
| 08-07-2006, 04:20 PM | #7 |
... No they wouldn't. Look, you create a location, AND remove it all in one step. You create an FX, AND destroy it all in one step. Those were just examples of behavior of some different data type and how they're similar. Thus that can be related back to how they WOULD leak if you didn't remove/destroy them as demonstrated. |
| 08-07-2006, 04:22 PM | #8 |
Yea, thought that. I merely missunderstood you. Thx anyway. |
