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!
The force will be removed and not leak.
The handle ID used by the force however might persist and leak unless you eithor eventually reuse the variable with another force or set it to null.
This is because it only recycles handle indexes once all references to it are nulled, and that includes global and local variables.
As long as the variable is reused it will not leak, the handleID leak is only a problem for once off coding.
The force will be removed and not leak.
The handle ID used by the force however might persist and leak unless you eithor eventually reuse the variable with another force or set it to null.
This is because it only recycles handle indexes once all references to it are nulled, and that includes global and local variables.
As long as the variable is reused it will not leak, the handleID leak is only a problem for once off coding.
So let's say, i put the actions in the command -cs, then write the integer(cs) to the player group converted in one player, then destroy force, will it leak?
EDIT: It should a little like this.
Creep Stats
Events:
Player - Player 2 (Blue) types -cs as an exact match
Player - Player 3 (Teal) types -cs as an exact match
Conditions:
Action:
Set Group=((Player Group(Owner of (Killing Unit)))
Game - Text (Group): (Integer(Cs[Player number of (Triggering Player)]))
I really don't think this one leaks, but I will respect Dr Super Good's words; it makes sense to leak, because it's a conversion of a player group, but it converts it into a player, when players do not need to be nullified. So, with the script above, Tiche3, I think there is no way to leak.
The conversion from a player to a player group uses the following function:
JASS:
function GetForceOfPlayer takes player whichPlayer returns force
local force f = CreateForce()
call ForceAddPlayer(f, whichPlayer)
return f
endfunction
It declares a local handle variable (force) and fails to null that variable. This will cause a leak.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.