- Joined
- Feb 25, 2010
- Messages
- 25
Would be it leaks if I pass a 'code' type variable (which is a function) as a parameter to another function?
Ex:
Ex:
JASS:
function DPS takes code c returns nothing
local group g = CreateGroup()
call GroupEnumUnitsInRect(g,GetPlayableMapRect(),null)
call ForGroup(g,c)
call GroupClear(g)
call DestroyGroup(g)
endfunction
function f takes nothing returns nothing
call SetUnitLifeBJ(GetEnumUnit(),GetUnitState(GetEnumUnit(),UNIT_STATE_LIFE)-1)
endfunction
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
call DPS(function f)
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
set gg_trg_Untitled_Trigger_001 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Untitled_Trigger_001, 0.01 )
call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction