Fixed memory leak in MarkedForDeath

This commit is contained in:
Jonathan Williams 2015-11-30 14:26:25 -06:00
parent 7bdf5451d4
commit 513810caaa

View File

@ -197,6 +197,30 @@ public class MarkedForDeath extends SkillActive
if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround()) if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround())
arrowIterator.remove(); arrowIterator.remove();
} }
for (Iterator<Player> activeIterator = _active.iterator(); activeIterator.hasNext();)
{
Player player = activeIterator.next();
if (!player.isOnline())
activeIterator.remove();
}
for (Iterator<LivingEntity> markedTimeIterator = _markedTime.keySet().iterator(); markedTimeIterator.hasNext();)
{
LivingEntity markedTime = markedTimeIterator.next();
if (markedTime.isDead() || !markedTime.isValid())
markedTimeIterator.remove();
}
for (Iterator<LivingEntity> markedDamageIterator = _markedDamage.keySet().iterator(); markedDamageIterator.hasNext();)
{
LivingEntity markedDamage = markedDamageIterator.next();
if (markedDamage.isDead() || !markedDamage.isValid())
markedDamageIterator.remove();
}
} }
@Override @Override