🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
If you are using GUI, then you shouldn't null variables. (The next time the trigger runs, that null value will be overwritten either way).
If you are using JASS, or custom scripts (containing local variables): yes, null them at the end.
Point should be both nulled and be removed by using the function call RemoveLocation.
The local variable is, local location <VariableName> = <LocationFunction>
Be aware that you must remove the location before nulling it as the null will throw away the handle for the object. You only need to null objects which have their handle index recycled (so local players do not need to be nulled) and only if you define the local inside the function (argument locals are not subject to the bug so do not need to be nulled, or so people say). You may also wish to null globals that will never be used again or are used very seldomly to allow the game engine maximum recycling efficiency.
No because the leak only occurs if the object the handle ID points at has been destroyed (so the handle ID needs to be recycled).
Not nulling such locals results in a counter leak (the reference counter is no longer accurate) so the handle ID of the object can not get recycled as it still thinks variables are pointing at it.
Locals created via arguments apparently do automatically decrement the handle counter but not ones you define via the local statmenet.
Object types like Players which are indestructable need not be nulled as the handle ID they use can never be recycled anyway so an incorrect reference counter can not cause a handle ID leak.
Just null all handles. That way you don't waste time during the development process "does this thing leak???"
Some indication that more handle pointers take up more RAM. I'll be providing a test map on this. If true, definitely null all handles, even ones you only use during initialization.
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.