Fix memory leak in ParticleFairy

This commit is contained in:
samczsun 2016-10-02 14:54:36 -04:00 committed by Shaun Bennett
parent a59dde44c6
commit 2b6d7a4d7a

View File

@ -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