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?
 
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
 
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.
Back
Top