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

[vJASS] nulling struct members

Status
Not open for further replies.
Level 3
Joined
Mar 14, 2011
Messages
32
Do I have to null members of struct on destroy to prevent leaks?
just wondering because a lot of people do that
 
Level 13
Joined
Mar 16, 2008
Messages
941
Somehow this is the truth and somehow not. It's true that globals don't need to be nulled if they get overwritten by new instances. The "if" is the problem. If you have sort of spikes of instances were suddenly many of them are created it can easily be that some struct members will never be nulled because this behaviour never happens again.
Nulling is realy not a big deal and if you want to be 100% sure do it.
However, not nulling is only relevant when the entire map leaks handle-indices.
 
Status
Not open for further replies.
Top