mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-18 17:34:11 +00:00
Possible memory leak fix
This commit is contained in:
parent
04390e758d
commit
54227b1d86
@ -834,6 +834,7 @@ class Player{
|
|||||||
$this->lag[] = microtime(true) - $this->recovery[$count]["sendtime"];
|
$this->lag[] = microtime(true) - $this->recovery[$count]["sendtime"];
|
||||||
$this->directDataPacket($this->recovery[$count]["id"], $this->recovery[$count], $this->recovery[$count]["pid"]);
|
$this->directDataPacket($this->recovery[$count]["id"], $this->recovery[$count], $this->recovery[$count]["pid"]);
|
||||||
++$this->packetStats[1];
|
++$this->packetStats[1];
|
||||||
|
$this->recovery[$count] = null;
|
||||||
unset($this->recovery[$count]);
|
unset($this->recovery[$count]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -845,6 +846,7 @@ class Player{
|
|||||||
}
|
}
|
||||||
if(isset($this->recovery[$count])){
|
if(isset($this->recovery[$count])){
|
||||||
$this->lag[] = microtime(true) - $this->recovery[$count]["sendtime"];
|
$this->lag[] = microtime(true) - $this->recovery[$count]["sendtime"];
|
||||||
|
$this->recovery[$count] = null;
|
||||||
unset($this->recovery[$count]);
|
unset($this->recovery[$count]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -855,6 +857,7 @@ class Player{
|
|||||||
$this->lag[] = microtime(true) - $d["sendtime"];
|
$this->lag[] = microtime(true) - $d["sendtime"];
|
||||||
$this->directDataPacket($d["id"], $d, $d["pid"]);
|
$this->directDataPacket($d["id"], $d, $d["pid"]);
|
||||||
++$this->packetStats[1];
|
++$this->packetStats[1];
|
||||||
|
$this->recovery[$count] = null;
|
||||||
unset($this->recovery[$count]);
|
unset($this->recovery[$count]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1676,6 +1679,8 @@ class Player{
|
|||||||
if(count($this->recovery) >= PLAYER_RECOVERY_BUFFER){
|
if(count($this->recovery) >= PLAYER_RECOVERY_BUFFER){
|
||||||
reset($this->recovery);
|
reset($this->recovery);
|
||||||
$k = key($this->recovery);
|
$k = key($this->recovery);
|
||||||
|
$this->recovery[$k] = null;
|
||||||
|
unset($this->recovery[$k]);
|
||||||
unset($this->recovery[$k]);
|
unset($this->recovery[$k]);
|
||||||
end($this->recovery);
|
end($this->recovery);
|
||||||
}
|
}
|
||||||
@ -1700,6 +1705,7 @@ class Player{
|
|||||||
if(count($this->recovery) >= PLAYER_RECOVERY_BUFFER){
|
if(count($this->recovery) >= PLAYER_RECOVERY_BUFFER){
|
||||||
reset($this->recovery);
|
reset($this->recovery);
|
||||||
$k = key($this->recovery);
|
$k = key($this->recovery);
|
||||||
|
$this->recovery[$k] = null;
|
||||||
unset($this->recovery[$k]);
|
unset($this->recovery[$k]);
|
||||||
end($this->recovery);
|
end($this->recovery);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user