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

Does this ACTION leak?

Status
Not open for further replies.
If I only remove the point variable via call RemoveLocation, will it leak if I don't null it?

no it will not nulling only removes the pointer. a variable is a pointer to the memory piece. RemoveLocation removes the memory from wc3. basically like deleting a file on ur pc. nulling it removes the shortcut to that file. hope that helps
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
WC3 process does take up more and more memory if you do not null them. Whether that is due to the operating system allocating more memory for some reason or it is a leak, is unclear. You'd have to have at least a hundred million unnulled globals for that to make any kind of difference, so don't worry about it.
 
WC3 process does take up more and more memory if you do not null them. Whether that is due to the operating system allocating more memory for some reason or it is a leak, is unclear. You'd have to have at least a hundred million unnulled globals for that to make any kind of difference, so don't worry about it.

although this is true i still like to null them. Whats one more simple line of code u know wat i mean ? Might as well make the map as efficient as possible lol. I even went back and nulled all my globals but that is easy with JNGP. for nulling going back to null them is really up to the coder.
 
Level 4
Joined
Jan 27, 2010
Messages
133
Might as well make the map as efficient as possible lol.

Nulling a variable that doesn't have to be nulled is about as helpful as DoNothing()... it obfuscates your code, and actually requires another line to be read by the JASS parser.

So, if efficiency == speed, then nulling globals will actually be slower. Nobody will of course ever notice, but still. I would not use the term "efficient" for that sort of coding behaviour.
 
Status
Not open for further replies.
Top