HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Global group type

03-14-2008, 05:23 PM#1
chobibo
I was making a spell that uses a global group array, to make it MUI I used gamecache to save the index, suddenly i tried using H2I to know if the previously used and destroyed group types no longer exist. As I understood it, if the variable array held nothing (no active group handle), then I would get an integer value of 0, to my suprise It held something. Then I tried nulling the global variable, and it held nothing. I'm assuming that not nulling array elements will leak handle Id's.

Now my questions are:
A) Are variables in jass like pointers to handle id's ? Because when I didn't null the global variable, handle Id's leaked, and when I nulled them they got reused. I'm not sure about this, I also didn't test it for a significant amount of time so I assume I'm wrong.
B)I don't need to null global variables, Yes or No?

Thanks for any help!
03-14-2008, 05:29 PM#2
Rising_Dusk
Quote:
Are variables in jass like pointers to handle id's ?
Correct.
Quote:
I don't need to null global variables, Yes or No?
You do not need to nullify globals if you reuse them, the process of nullifying recycles the current handle index the same way as setting it to a new value.
03-14-2008, 05:33 PM#3
chobibo
Wow that was both fast and informative! Thanks !