• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Null location/Groups?

Status
Not open for further replies.
Level 22
Joined
Sep 24, 2005
Messages
4,821
You still need to set global variables to null though, since they leak memory if the object their referencing is already removed.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
I heard it was only certain types that could be nulled.
Must be atomic data types.

I also heard it could cause crashes if nulled at the wrong time or something.
Could you please provide a link. I didn't know that, I never authored an entire map, just spell triggers.

Most GUIers just skip this.
That would be bad for periodic triggers, since the leaks would accumulate and make the game lag on computers installed with low memory (1gb below). I guess that would be okay for triggers that only use variables once though.

EDIT: Here's a link to the reference leak I was talking about. Troll-Brain found that one.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
all types that extend agent must be nulled no matter if global or local variable, because agent is reference counted, and until at least one variable references given object, its handleid wont get recycled(4 bytes leak per object)

according to thread provided by Chobibo, if you dont null agent immedietally after you destroy it, it will leak
 
Status
Not open for further replies.
Top