mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 08:56:15 +00:00
Fixed chunk object memory leak when chunks are changed, close #419
If a player quit the server in the 1-second between a chunk changing and a fresh chunk-order requesting a resend of that chunk, the player wouldn't know they were using that chunk and did not unregister themselves, causing the subject chunks to always remain loaded.
This commit is contained in:
@ -4088,7 +4088,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
}
|
||||
|
||||
public function onChunkChanged(Chunk $chunk){
|
||||
unset($this->usedChunks[Level::chunkHash($chunk->getX(), $chunk->getZ())]);
|
||||
if(isset($this->usedChunks[$hash = Level::chunkHash($chunk->getX(), $chunk->getZ())])){
|
||||
$this->usedChunks[$hash] = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function onChunkLoaded(Chunk $chunk){
|
||||
|
Reference in New Issue
Block a user