mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Destroy NBT references when closing entities, alleviates memory issues on leaked Player objects
This does NOT FIX THE ACTUAL ISSUES, only eliminates some of the symptoms.
This commit is contained in:
@ -1643,10 +1643,15 @@ abstract class Entity extends Location implements Metadatable{
|
||||
$this->despawnFromAll();
|
||||
if($this->chunk !== null){
|
||||
$this->chunk->removeEntity($this);
|
||||
$this->chunk = null;
|
||||
}
|
||||
|
||||
if($this->getLevel() !== null){
|
||||
$this->getLevel()->removeEntity($this);
|
||||
$this->setLevel(null);
|
||||
}
|
||||
|
||||
$this->namedtag = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user