Warcraft III resources & community, 2003–2006 · archived

Memory leaks in unit arrays

6 posts
#1

Memory leaks in unit arrays

How can I avoid memory leaks when using unit arrays?
The problem is that I cant just remove units from the game or use unit groups.
#2
If you want to remove leaks by removing the units, use a loop. If you want to destroy it if it's a local unit array, use a loop too.
#3
I can't simply remove units from my local array from the game!

The problem is that all units must have numbers - and custom value is already used.
#4
I can't simply remove units from my local array from the game!

The problem is that all units must have numbers - and custom value is already used.
#5
Sorry but as I can't see the script I can't help you. I suggest you to use the handle vars, get them from The JASS Vault. Ask questions about them there aswell, I can't help you the next two weeks, as I'm going on holiday :D .
#6
To stop leaking from unit arrays you can remove the unit from the game or flush the value of the variable.

local unit U
set U = null

I think this will work.