KillUnit()
out of habit. Using RemoveUnit()
doesn't show death animations of effects attached to the dummy unit.When a unit dies it starts decaying, if it can. After it's decayed it will be removed from game. RemoveUnit() directly removes the unit from game.
From tests in pasts units seem to always leak a tiny bit of memory, even after being removed from game (~0.04kb). A question about trigger leaks
Sigh... no need to be ironic. Wietlol (I think it was him) always tells people to use UnitApplyTimedLife instead of KillUnit, because KillUnit leaks. I suppose it leaks more than 0,04kb, and that's why he's suggesting that to people.Your dummy classifies as an unit. I found this from the depths of Hive somewhere (ofc I don't expect you to dig every corner before posting, so I dug it up for you):
UnitApplyTimedLife()
being better than KillUnit()
in some way.Can you link to the post where you made that discovery? Or can you provide a testmap? Because this is the first time I heard about that and there is absolutely no way the community would have missed that in over 10 years of Warcraft.UnitApplyTimedLife() is one way to do it.
If it requires to be instant, use SetWidgetLife(u, 0).
Unit handles arent properly removed hence why every unit will leak 4 bytes?... I dont know the actual number but at least something.
Using KillUnit() has a massive RAM increase when using KillUnit() and immediately RemoveUnit() after that compared to only RemoveUnit().
However, this may be because of death models such as blood etc, but this is not the case for SetWidgetLife(), UnitApplyTimedLife() and UnitDamageTarget().
(This RAM increase is not removed within 10 minutes... I didnt test longer than that.)