• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Death event leak

Status
Not open for further replies.
Level 4
Joined
Mar 23, 2009
Messages
78
to register units' deaths, i use this (for all players):
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
and to check if there are leaks this old good function
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
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?
 
Last edited:
Level 4
Joined
Mar 23, 2009
Messages
78
is there a way to decrease this time? i searched such field in constants menu, but changes i've done didn't have any effect.
 
Status
Not open for further replies.
Top