• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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