Moon_Raven
New Member
- Reaction score
- 8
Hello, I started to work with JASS recently, and I am still a big newbie to it. So, I have a trigger like this that works perfectly:
But when I add the "call DestroyTrigger(MyTrigger)" code for destroying the leak, it doesn't work:
Why doesn't it work now? Did I fix it wrong? Or the trigger doesn't leak?
JASS:
function TextActions takes nothing returns nothing
call Msg("Hello",0)
endfunction
function InitTrig_Text takes nothing returns nothing
local trigger MyTrigger = CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic(MyTrigger,Player(0))
call TriggerAddAction(MyTrigger,function TextActions)
endfunction
But when I add the "call DestroyTrigger(MyTrigger)" code for destroying the leak, it doesn't work:
JASS:
function TextActions takes nothing returns nothing
call Msg("Hello",0)
endfunction
function InitTrig_Text takes nothing returns nothing
local trigger MyTrigger = CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic(MyTrigger,Player(0))
call TriggerAddAction(MyTrigger,function TextActions)
call DestroyTrigger(MyTrigger)
endfunction
Why doesn't it work now? Did I fix it wrong? Or the trigger doesn't leak?