- Joined
- Jan 28, 2016
- Messages
- 486
I'm not sure how to explain this but here goes.
Generally speaking, I know that all variables apart from integer, real, boolean and string will leak. However in the well-known leak tutorials, the player variable is never addressed. I know how to clear the leak in JASS but I cannot find a straight answer to confirm if player variables in GUI actions leak (Eg: the Unit - Create Unit actions).
Below are two triggers; the first uses a variable to store the player and which is then nulled afterwards. The second doesn't use a variable, but will it still leak a player reference?
Generally speaking, I know that all variables apart from integer, real, boolean and string will leak. However in the well-known leak tutorials, the player variable is never addressed. I know how to clear the leak in JASS but I cannot find a straight answer to confirm if player variables in GUI actions leak (Eg: the Unit - Create Unit actions).
Below are two triggers; the first uses a variable to store the player and which is then nulled afterwards. The second doesn't use a variable, but will it still leak a player reference?
-
Reinforcements with Player Variable
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Reinforcements
-
-
Actions
-
Set Caster = (Triggering unit)
-
Set User = (Owner of Caster)
-
Set Location = (Target point of ability being cast)
-
Unit - Create 3 Footman for User at Location facing (Facing of Caster) degrees
-
Custom script: set udg_Caster = null
-
Custom script: set udg_User = null
-
Custom script: set RemoveLocation(udg_Location) = null
-
-
-
Reinforcements without Player Variable
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Reinforcements
-
-
Actions
-
Set Location = (Target point of ability being cast)
-
Unit - Create 3 Footman for (Owner of (Triggering unit)) at Location facing (Facing of (Triggering unit)) degrees
-
Custom script: set RemoveLocation(udg_Location) = null
-
-
Last edited by a moderator: