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.
This commit is contained in:
Dylan K. Taylor 2018-02-27 11:08:09 +00:00
parent 2a09aaf456
commit e024f381c9

View File

@ -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();
}
}
}