- Joined
- Aug 27, 2012
- Messages
- 362
Do local triggers need to be nulled? I was under the impression that they didn't, but today someone suggested in my spell submission that I should null the local trigger created in my OnInit function. Is there any point in doing this?
I guess to clarify,
Is this fine? Is it fine if I don't null the trigger too?
Iirc, making triggers like this creates an unavoidable leak anyways, so there would be no point in nulling it?
I guess to clarify,
JASS:
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(trig,Condition(function OnSpell))
set trig = null
endfunction
Is this fine? Is it fine if I don't null the trigger too?
Iirc, making triggers like this creates an unavoidable leak anyways, so there would be no point in nulling it?