• 🏆 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!

Where to put "Destroy TriggeringTrigger?"

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
Hi,

If we want to destroy a trigger inside its own condition (preferably after it has done all its work), do we need to put the call in any particular spot?

e.g.

JASS:
function main takes nothing returns boolean
  //do some work
  ...
  //clean up local handles
  ...
  //destroy this trigger
  call DestroyTrigger(GetTriggeringTrigger())
endfunction

Here I made it the very last call, but what if I put it here

JASS:
function main takes nothing returns boolean
  //do some work
  ...
  //destroy this trigger
  call DestroyTrigger(GetTriggeringTrigger())
  //clean up local handles
  ...
endfunction

Will my local handles still leak? Or will the condition run to completion, and then destroy the trigger?
 
Status
Not open for further replies.
Top