• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Variable

Status
Not open for further replies.
Level 28
Joined
Jan 26, 2007
Messages
4,789

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,233
Point should be both nulled and be removed by using the function call RemoveLocation.

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.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,233
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.
 
Status
Not open for further replies.
Top