mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-29 06:05:54 +00:00
Fixed inventory cyclic references causing players to not get garbage-collected
This commit is contained in:
parent
770616d4ab
commit
da4c9cf404
@ -3503,6 +3503,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
$this->removeAllWindows(true);
|
$this->removeAllWindows(true);
|
||||||
$this->windows = null;
|
$this->windows = null;
|
||||||
$this->windowIndex = [];
|
$this->windowIndex = [];
|
||||||
|
$this->cursorInventory = null;
|
||||||
|
|
||||||
if($this->constructed){
|
if($this->constructed){
|
||||||
parent::close();
|
parent::close();
|
||||||
|
@ -537,6 +537,8 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
|||||||
foreach($this->inventory->getViewers() as $viewer){
|
foreach($this->inventory->getViewers() as $viewer){
|
||||||
$viewer->removeWindow($this->inventory);
|
$viewer->removeWindow($this->inventory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->inventory = null;
|
||||||
}
|
}
|
||||||
parent::close();
|
parent::close();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user