From e024f381c922c1bc19b40de8391962371fe367f3 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 27 Feb 2018 11:08:09 +0000 Subject: [PATCH] Living: fixed cycle between armor inventory and holder not getting cleaned up on close this was getting collected by the cycle GC, but it should have been dealt with properly like other inventories. --- src/pocketmine/entity/Living.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index 2d1ce7694..a23d9f254 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -809,4 +809,14 @@ abstract class Living extends Entity implements Damageable{ $this->armorInventory->sendContents($player); } + + public function close(){ + if(!$this->closed){ + if($this->armorInventory !== null){ + $this->armorInventory->removeAllViewers(true); + $this->armorInventory = null; + } + parent::close(); + } + } }