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

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,258
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,258
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