simple struct leak question

Laiev

Hey Listen!!
Reaction score
188
i need null member of struct to prevent leaks? like units, groups, locations, etc?
 

Laiev

Hey Listen!!
Reaction score
188
thx kingking, at least starcraft 2 don't will leak <-.- well, at least blizzard said that>
 

Laiev

Hey Listen!!
Reaction score
188
no, globals variables are globals and always will be replaced by others things <like global unit gettriggerunit, the trigger unit always will change>

in local function and struct function each variable got a handle unique and unreplaceable, if you don't null it, will eat <lol> the memory of warcraft and will cause leaks :)

EDIT: globals variables are like gui variables, if you set it first time and set it again, the first set don't will be saved in that variable, just the last :p
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
no, globals variables are globals and always will be replaced by others things <like global unit gettriggerunit, the trigger unit always will change>

in local function and struct function each variable got a handle unique and unreplaceable, if you don't null it, will eat <lol> the memory of warcraft and will cause leaks :)

EDIT: globals variables are like gui variables, if you set it first time and set it again, the first set don't will be saved in that variable, just the last :p

Struct members are globals. There is a testing which done by Jesus4lyf here.
 

Laiev

Hey Listen!!
Reaction score
188
except if i make a private struct :x.. just kidding

but is like a 'local variables with global usable' right?

i can't explain better.....

something like... a unique id for a variable <like local> but one which can be used in every were <like global>
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
They are not necessarily unique id's, but rather unique indexes. =D They are globals in reality. It is just that they use an array system to avoid problems with MUI, overwriting, and all that.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Do you need to null struct members? I wish the answer were simple.

If you want to be as leak free as possible, yes.
If you don't care that much, or expect to have a fairly consistent number of structs of a type, no.

Depends further if you're talking about handle id recycling, or any RAM leak, because there was a bug in one of the patches where not nulling handles immediately when they're destroyed causes a leak. Dunno if that's still around, probably is. (Which applies to straight globals, also.)

Structs reuse array indexes, so if you will incur the same number of structs again in the future, the handle ids will be recycled them when you overwrite the value of the member. :)
 

Laiev

Hey Listen!!
Reaction score
188
I ever null after destroy a handle :p don't know why i do it, but is just 'automatic' lol

OT: Jesus4Lyf i really like yours system and snipped, i use most of them lol and if possible in some update version of AIDS, you can add the news functions of AutoIndex, because people use AutoIndex but is incompatible -.-
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top