Hi
I know how to remove memory leak for basic trigger. but I still don't understand memory leak in follow situation :
Question 1:
what the difference between "remove all unit from temp_group" and "Destory group (temp_group)" ? do first one result leak ?
Question 2:
if you store point into array, :
points_array[1] = location of unit_a
points_array[2] = location of unit_b
do something here
points_array[1] = location of unit_c
points_array[2] = location of unit_d
removeLocation(points_array[1])
removeLocation(points_array[2])
do I need removeLocation in middle ?
Question 3:
if I use hastable to store points (same as question 2, but use hashtable). do I still need to apply removeLocation ?
Question 4 : why remove location cause bug in this situation ?
Global variable :
SpawnPoint[1] = center of region 1
SpawnPoint[2] = center of region 2
...
Trigger :
for every unit A of unit Group_G
temp_point = SpawnPoint[player number of the unit A]
move unit A to temp_point
removeLocation(temp_point)
// bug result, value inside SpawnPoint[] will become null :banghead:
Thank for help
I know how to remove memory leak for basic trigger. but I still don't understand memory leak in follow situation :
Question 1:
what the difference between "remove all unit from temp_group" and "Destory group (temp_group)" ? do first one result leak ?
Question 2:
if you store point into array, :
points_array[1] = location of unit_a
points_array[2] = location of unit_b
do something here
points_array[1] = location of unit_c
points_array[2] = location of unit_d
removeLocation(points_array[1])
removeLocation(points_array[2])
do I need removeLocation in middle ?
Question 3:
if I use hastable to store points (same as question 2, but use hashtable). do I still need to apply removeLocation ?
Question 4 : why remove location cause bug in this situation ?
Global variable :
SpawnPoint[1] = center of region 1
SpawnPoint[2] = center of region 2
...
Trigger :
for every unit A of unit Group_G
temp_point = SpawnPoint[player number of the unit A]
move unit A to temp_point
removeLocation(temp_point)
// bug result, value inside SpawnPoint[] will become null :banghead:
Thank for help