mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
PermissibleBase: more robust cycle destruction
This commit is contained in:
parent
87033592b1
commit
c20893aa4b
@ -152,12 +152,6 @@ class PermissibleBase implements Permissible{
|
||||
Timings::$permissibleCalculationTimer->stopTiming();
|
||||
}
|
||||
|
||||
public function clearPermissions() : void{
|
||||
PermissionManager::getInstance()->unsubscribeFromAllPermissions($this->getRootPermissible());
|
||||
|
||||
$this->permissions = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool[] $children
|
||||
*/
|
||||
@ -181,4 +175,11 @@ class PermissibleBase implements Permissible{
|
||||
public function getEffectivePermissions() : array{
|
||||
return $this->permissions;
|
||||
}
|
||||
|
||||
public function destroyCycles() : void{
|
||||
PermissionManager::getInstance()->unsubscribeFromAllPermissions($this->getRootPermissible());
|
||||
$this->permissions = []; //PermissionAttachmentInfo doesn't reference Permissible anymore, but it references PermissionAttachment which does
|
||||
$this->attachments = []; //this might still be a problem if the attachments are still referenced, but we can't do anything about that
|
||||
$this->parent = null;
|
||||
}
|
||||
}
|
||||
|
@ -2008,7 +2008,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
$this->removeCurrentWindow();
|
||||
$this->removePermanentInventories();
|
||||
|
||||
$this->perm->clearPermissions();
|
||||
$this->perm->destroyCycles();
|
||||
|
||||
$this->flagForDespawn();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user