Variable

Level 27
Joined
Jan 26, 2007
Messages
4,788

Dr Super Good

Spell Reviewer
Level 62
Joined
Jan 18, 2005
Messages
27,037
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 62
Joined
Jan 18, 2005
Messages
27,037
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.
 
Top