• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Where to put "Destroy TriggeringTrigger?"

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
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