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

Group leak question

Status
Not open for further replies.
Level 8
Joined
Apr 30, 2009
Messages
338
I want to do this and need to know if it leaks:

set udg_temp_group = units matching condition
save handle of (udg_temp_group) as key(group) of key(triggering unit) in (udg_hashtable_1)
set udg_temp_group = null


So that I can call these units later with the hashtable handle without needing a permanent global variable. If I use the following, it seems the hashtable handle is useless:

set udg_temp_group = units matching condition
save handle of (udg_temp_group) as key(group) of key(triggering unit) in (udg_hashtable_1)
call DestroyGroup(udg_temp_group)


And if none of that works, how do I save a unit group in a hastable without using a global variable?
 
Level 8
Joined
Apr 30, 2009
Messages
338
I just want to know if temp_group will leak if I:

- set it to a group of units
- save its handle in a hashtable
- set it to null instead of destroying it
 
Level 6
Joined
May 19, 2004
Messages
267
Use the first method, no need to null a global.
It'll not leak as long as you clean the leak at a later point (i.e after it has been loaded from the hashtable).
 
Status
Not open for further replies.
Top