Destroy NBT references when closing entities, alleviates memory issues on leaked Player objects

This does NOT FIX THE ACTUAL ISSUES, only eliminates some of the symptoms.
This commit is contained in:
Dylan K. Taylor 2017-03-12 10:53:27 +00:00
parent a71747347f
commit 4f27bce5b3

View File

@ -1643,10 +1643,15 @@ abstract class Entity extends Location implements Metadatable{
$this->despawnFromAll();
if($this->chunk !== null){
$this->chunk->removeEntity($this);
$this->chunk = null;
}
if($this->getLevel() !== null){
$this->getLevel()->removeEntity($this);
$this->setLevel(null);
}
$this->namedtag = null;
}
}