From 5dade755eb25038b30f06ecdd995184ad5074894 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Tue, 14 May 2013 23:46:32 +0200 Subject: [PATCH] Fixed Player memory leak --- src/Player.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Player.php b/src/Player.php index 96bcce665..bb9103963 100644 --- a/src/Player.php +++ b/src/Player.php @@ -633,6 +633,9 @@ class Player{ } public function measureLag(){ + if($this->connected === false){ + return false; + } $this->lag[0] = microtime(true) * 1000; $this->dataPacket(MC_PING, array( "time" => (int) $this->lag[0], @@ -1121,7 +1124,7 @@ class Player{ if($this->spawned === false){ break; } - $t = $this->server->api->tileentity->get($data["x"], $data["y"], $data["z"]); + $t = $this->server->api->tileentity->get(new Position($data["x"], $data["y"], $data["z"], $this->level)); if(($t[0] instanceof TileEntity) and $t[0]->class === TILE_SIGN){ $t = $t[0]; if($t->data["creator"] !== $this->username){