diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 2003a1241..b19c93ac7 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -3503,6 +3503,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $this->removeAllWindows(true); $this->windows = null; $this->windowIndex = []; + $this->cursorInventory = null; if($this->constructed){ parent::close(); diff --git a/src/pocketmine/entity/Human.php b/src/pocketmine/entity/Human.php index 436bd2f44..e75af5be3 100644 --- a/src/pocketmine/entity/Human.php +++ b/src/pocketmine/entity/Human.php @@ -537,6 +537,8 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ foreach($this->inventory->getViewers() as $viewer){ $viewer->removeWindow($this->inventory); } + + $this->inventory = null; } parent::close(); }