• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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