mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 01:51:51 +00:00
Level: Fixed leak of global packets when no players are online
If a global packet was broadcasted when no players were online, it would be held in memory indefinitely (until a player joined).
This commit is contained in:
parent
70635d0870
commit
9e1fa453ad
@ -797,8 +797,10 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$this->checkSleep();
|
$this->checkSleep();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($this->players) and !empty($this->globalPackets)){
|
if(!empty($this->globalPackets)){
|
||||||
|
if(!empty($this->players)){
|
||||||
$this->server->batchPackets($this->players, $this->globalPackets);
|
$this->server->batchPackets($this->players, $this->globalPackets);
|
||||||
|
}
|
||||||
$this->globalPackets = [];
|
$this->globalPackets = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user