lovexylitol
New Member
- Reaction score
- 2
I have a map under development and found the following code leaks.
To be exact, the handle count is increasing once per time when I
call this code. I called this code once every 0.01, and the handle count
after an hour was about in the order of several hundred thousands, and
memory war3.exe was over 600mb; therefore the code does leak.
This function is supposed to get a count(i) of a type of unit(u) owned by a player(p). I have also tried using CountLivingPlayerUnitsOfTypeId, and got
the same results. Is there a way to do this? Or is it supposed to leak?
Thank you for your replies.
JASS:
function xylitolGetUnitNumber takes player p, integer u returns integer
local integer i
set udg_xGroup = GetUnitsOfPlayerAndTypeId(p, u)
set i = CountUnitsInGroup(udg_xGroup)
call DestroyGroup(udg_xGroup)
return i
endfunction
To be exact, the handle count is increasing once per time when I
call this code. I called this code once every 0.01, and the handle count
after an hour was about in the order of several hundred thousands, and
memory war3.exe was over 600mb; therefore the code does leak.
This function is supposed to get a count(i) of a type of unit(u) owned by a player(p). I have also tried using CountLivingPlayerUnitsOfTypeId, and got
the same results. Is there a way to do this? Or is it supposed to leak?
Thank you for your replies.