Go
Wc3C.net
»
Warcraft III Modding
»
Developer's Corner
»
Triggers & Scripts
»
local trigger leaking...
local trigger leaking...
10-07-2006, 02:11 AM
#1
darkwulfv
Ok, if I make a local trigger, should I set the variable to null, or are triggers not considered handles?
JASS:
function
Init_Trigger
takes
nothing
returns
nothing
local
trigger
t
=
CreateTrigger
( )
for example.
10-07-2006, 02:15 AM
#2
PipeDream
Jump through the hoops for anything which you intend to Destroy* or Remove* later.
10-07-2006, 02:17 AM
#3
darkwulfv
Umm what? Does that mean null or leave it alone?
10-07-2006, 02:51 AM
#4
moyack
Everything that is a handle can be nullified, so if you do that, is like ensuring that your code will run without leak.
Personally, I set to null the triggers in the inittrigger function.
10-07-2006, 03:04 AM
#5
darkwulfv
Ok, thats what I wanted to know. Thanks.
10-07-2006, 03:19 AM
#6
Vexorian
It is not necesary to set handles to null if they are not going to be destroyed (dead units, Destroy* or Remove* functions)
although most of times, setting them to null won't cause any harm and helps you get a nulling habit with the problem of timers though
10-07-2006, 05:43 PM
#7
BertTheJasser
Triggers are handles, but as vex mentioned, persisting handles don't have to be nulled, other than temporary handles.