to register units' deaths, i use this (for all players):
and to check if there are leaks this old good function
every time trigger's worked, i get 1 leak. i suggest that problem is in TriggerRegisterPlayerUnitEvent, cause it returns event. so how can i disable this source of leak?
JASS:
local integer i=0
set <trig> = CreateTrigger()
loop
call TriggerRegisterPlayerUnitEvent(<trig>,Player(i),EVENT_PLAYER_UNIT_DEATH,null)
set i=i+1
exitwhen i==bj_MAX_PLAYER_SLOTS
endloop
JASS:
function Trig_check_Actions takes nothing returns nothing
local timer Timer = CreateTimer()
local string S
local integer i = 0
if udg_i_test < GetHandleId(Timer) then
set S = ("|cffaaaaaa [Test] H: " + I2S(GetHandleId(Timer) - 1048500) + "|r")
call DisplayTextToPlayer(Player(0), 0, 0, S)
set S = null
set udg_i_test = GetHandleId(Timer)
endif
call DestroyTimer(Timer)
set Timer = null
endfunction
function InitTrig_check takes nothing returns nothing
set gg_trg_check = CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_check, 0.1, true)
call TriggerAddAction(gg_trg_check, function Trig_check_Actions)
endfunction
Last edited: