Don't hold player references for hiddenPlayers

they aren't needed, and this is just one more thing that could go wrong in Player->close() that could lead to leaks.
This commit is contained in:
Dylan K. Taylor 2017-10-09 09:20:34 +01:00
parent 119913da30
commit ebcce43131

View File

@ -264,7 +264,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
protected $loadQueue = [];
protected $nextChunkOrderRun = 5;
/** @var Player[] */
/** @var bool[] map: raw UUID (string) => bool */
protected $hiddenPlayers = [];
/** @var Vector3|null */
@ -503,7 +503,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
if($player === $this){
return;
}
$this->hiddenPlayers[$player->getRawUniqueId()] = $player;
$this->hiddenPlayers[$player->getRawUniqueId()] = true;
$player->despawnFrom($this);
}