Fix memory leak in ParticleFairy
This commit is contained in:
parent
a59dde44c6
commit
2b6d7a4d7a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user