HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Does this code make game leaks ?

03-12-2006, 02:11 AM#1
chien86
local location temppoint = GetRectCenter(gg_rct_Creep_Center_2)
call IssuePointOrderLocBJ( GetEnteringUnit(), "attack", temppoint )
call RemoveLocation(temppoint)
set temppoint = null

And if leaks, please show me how to fix
Thanks!
03-12-2006, 02:19 AM#2
shadow1500
it duzent leak, but u could achive extra optimization by replacing the BJ with a native.
03-12-2006, 04:46 AM#3
TaintedReality
So after using RemoveLocation() you still have to set the variable to null? I've never been clear on that.
03-12-2006, 06:35 AM#4
chien86
Ya after RemoveLocation() still set to null !!
BTW, is setting variable to null after RemoveLocation() is neccesary ?
03-12-2006, 06:45 AM#5
Jacek
Yes... after RemoveLocation() you still need to nullify it. I may be wrong... but... isn't GetEnteringUnit() leaking?
03-12-2006, 07:22 AM#6
The__Prophet
No, GetEnteringUnit() does not leak, unless you set it to a variable, and dont null that.
03-12-2006, 08:23 AM#7
Jacek
He isn't setting it to variable.
03-12-2006, 08:27 AM#8
Blade.dk
The local location variable should be set to null to avoid leaks.

GetEnteringUnit does not leak, as it doesn't create any new object or similiar. I think you could replace it with GetTriggerUnit though, that would most likely be faster.
03-12-2006, 11:26 AM#9
chien86
oh, ya I forgot to use GetTriggerUnit
Maybe it will improve game's speed !!!
anyway thanks !