Guard against leaked closed tiles leaking chunks and NBT trees

Once again, this does not fix the actual issue, only reduces the impact of it.
This commit is contained in:
Dylan K. Taylor 2017-03-18 11:08:05 +00:00
parent fa5e66478c
commit cbb003bf29

View File

@ -173,11 +173,14 @@ abstract class Tile extends Position{
unset($this->level->updateTiles[$this->id]);
if($this->chunk instanceof Chunk){
$this->chunk->removeTile($this);
$this->chunk = null;
}
if(($level = $this->getLevel()) instanceof Level){
$level->removeTile($this);
$this->setLevel(null);
}
$this->level = null;
$this->namedtag = null;
}
}