From 2b6d7a4d7ab051a371e676b3434079e3c16b10d2 Mon Sep 17 00:00:00 2001 From: samczsun Date: Sun, 2 Oct 2016 14:54:36 -0400 Subject: [PATCH] Fix memory leak in ParticleFairy --- .../core/gadget/gadgets/particle/ParticleFairy.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairy.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairy.java index 2116e7604..452410209 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairy.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairy.java @@ -32,7 +32,18 @@ public class ParticleFairy extends ParticleGadget // Create if (!_fairy.containsKey(player)) _fairy.put(player, new ParticleFairyData(player)); - _fairy.get(player).Update(); + ParticleFairyData data = _fairy.get(player); + + if (!data.Fairy.getWorld().equals(player.getWorld())) + { + data.Fairy = null; + data.Player = null; + data.Target = null; + data = new ParticleFairyData(player); + _fairy.put(player, data); + } + + data.Update(); } @Override