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

[Solved] Hashtable Leaks?

Status
Not open for further replies.
Level 2
Joined
Apr 1, 2019
Messages
156
In a TD I'm trying to set a large number of units to a hashtable each wave.
How do I remove all the units from the Hashtable between Waves so it doesn't leak each wave?

Clear child hashtable wants a specific value, which that unit is only saved to that hashtable so I don't know how to get that value.

If I use Clear Parent hashtable it seems to delete the hashtable entirely and I can't use it anymore.

What I used is,
  • Hashtable - Save Handle OfNo unit as SendsLimit[(Integer A)] of (Integer A) in SpawnsUnits[1]
I don't know if that would work to clear the leaks
 
Level 7
Joined
Apr 17, 2017
Messages
316
if it's integer do this: call RemoveSavedInteger(udg_SpawnsUnits[1], bj_forLoopAIndex, udg_SendsLimit[bj_forLoopAIndex])
if it's a handle do this: call RemoveSavedHandle(udg_SpawnsUnits[1], bj_forLoopAIndex, udg_SendsLimit[bj_forLoopAIndex])
but you need to store your integer loop tho. Or else, since hashtables have 2 keys (child and parent), if you store each wave number corresponding to wave number, like: Save wave1monster as integer A of wavenumber. Then you can clear hashtables using their wave number.
 
Level 2
Joined
Apr 1, 2019
Messages
156
Thanks man, sorry for the late response I've been busy.

I have it set up so players send the wave units to other players. So the Parent is the player, [(Integer A)] and the child is each unit he sends SendsLimit[(Integer A)].
I clear the Hashtable completely after each wave.

Works great no late game lag thanks again.
 
Status
Not open for further replies.
Top