From 513810caaad56c5578c503b4b623bf4658683d1d Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Mon, 30 Nov 2015 14:26:25 -0600 Subject: [PATCH] Fixed memory leak in MarkedForDeath --- .../Skill/Assassin/MarkedForDeath.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/MarkedForDeath.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/MarkedForDeath.java index 615508a77..e2ec6e686 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/MarkedForDeath.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/MarkedForDeath.java @@ -197,6 +197,30 @@ public class MarkedForDeath extends SkillActive if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround()) arrowIterator.remove(); } + + for (Iterator activeIterator = _active.iterator(); activeIterator.hasNext();) + { + Player player = activeIterator.next(); + + if (!player.isOnline()) + activeIterator.remove(); + } + + for (Iterator markedTimeIterator = _markedTime.keySet().iterator(); markedTimeIterator.hasNext();) + { + LivingEntity markedTime = markedTimeIterator.next(); + + if (markedTime.isDead() || !markedTime.isValid()) + markedTimeIterator.remove(); + } + + for (Iterator markedDamageIterator = _markedDamage.keySet().iterator(); markedDamageIterator.hasNext();) + { + LivingEntity markedDamage = markedDamageIterator.next(); + + if (markedDamage.isDead() || !markedDamage.isValid()) + markedDamageIterator.remove(); + } } @Override