HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Leak Question

08-07-2006, 02:36 PM#1
Sharingan
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
Collapse JASS:
GetUnitLoc(unit_x)
?
08-07-2006, 02:54 PM#2
Rising_Dusk
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
Sharingan
Is location actually the only type which would leak like that?
For example, maybe rects too?
Or effects...
Collapse JASS:
DestroyEffect(AddSpecialEffect....)
08-07-2006, 04:03 PM#4
Vexorian
Take a guess
08-07-2006, 04:05 PM#5
Rising_Dusk
Yeah, they all leak like that in case you didn't figure it out.

Notably --
Collapse JASS:
call DestroyEffect(AddSpecialEffect(...))
Works the same way as
Collapse JASS:
call RemoveLocation(GetUnitLoc(...))
So it should be obvious that many other data types will show the same behavior.
08-07-2006, 04:18 PM#6
Sharingan
Er, so
Collapse JASS:
call DestroyEffect(AddSpecialEffect(...))
call RemoveLocation(GetUnitLoc(...))
would leak?
08-07-2006, 04:20 PM#7
Rising_Dusk
... 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
Sharingan
Yea, thought that.
I merely missunderstood you.
Thx anyway.