• 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.

[Trigger] Need some help with some memory leaks [GUI]

Status
Not open for further replies.
Level 3
Joined
Mar 7, 2008
Messages
25
ok so this is the problem:
I made a variable tip: "Set Temp_Cast = Casting Unit"

I donno how to remove the variable.... i know that for temp_points is "cal udg removelocation(temp_point) .... need help...i'm a bit confused...:confused:
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
As long as you set the variable in the variable editor, it's global.. to prove that, make a new trigger and only set a variable in it.
  • Set bla = (Triggering unit)
It will look like this

Then convert the trigger into jass and it will look like this
JASS:
Set udg_bla = GetTriggeringUnit()
or similar.
udg stands for user defined global (as far as i know and is therefore global ;)
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
As long as you set the variable in the variable editor, it's global.. to prove that, make a new trigger and only set a variable in it.
  • Set bla = (Triggering unit)
It will look like this

Then convert the trigger into jass and it will look like this
JASS:
Set udg_bla = GetTriggeringUnit()
or similar.
udg stands for user defined global (as far as i know and is therefore global ;)
set udg_bla = GetTriggerUnit()
to set globals to locals in GUI
custom script local variabletype udg_variable
and use it in your trigger
Max 1 per trigger.
set it to no unit and try to nullify it with custom script: set udg_Temp_cast = null
Blah, please look into reference leaks before preaching how they work.
ok so this is the problem:
I made a variable tip: "Set Temp_Cast = Casting Unit"

I donno how to remove the variable.... i know that for temp_points is "cal udg removelocation(temp_point) .... need help...i'm a bit confused...:confused:
Removing an object only is necessary when you want to remove it from the game's memory; in the case of locations, since you won't be using them again but they are objects, this is required.

However, since a unit won't "leak" the same way in most cases (Since you still want it to be running around doing stuff), you most likely don't want to remove it.
 
Level 3
Joined
Mar 7, 2008
Messages
25
k so i guess that i dont have to remove the object's variable, huh

btw: are u administrator ?!?!?!?!?

?:infl_thumbs_up:
 
Status
Not open for further replies.
Top