mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Removed unnecessary and/or obsolete GC hacks
the intent of these hacks was to break cyclic references to avoid having objects lingering in memory. However, all of the stuff that's being removed in this commit no longer has any effect anyway, due to the fact that these things don't circularly reference each other anymore. Notably, Tile inventories now keep Position instead of a Tile ref.
This commit is contained in:
parent
c05f6db8d9
commit
91d54ff0ad
@ -53,7 +53,6 @@ class Barrel extends Spawnable implements Container, Nameable{
|
||||
public function close() : void{
|
||||
if(!$this->closed){
|
||||
$this->inventory->removeAllViewers();
|
||||
$this->inventory = null;
|
||||
parent::close();
|
||||
}
|
||||
}
|
||||
|
@ -90,7 +90,6 @@ class BrewingStand extends Spawnable implements Container, Nameable{
|
||||
public function close() : void{
|
||||
if(!$this->closed){
|
||||
$this->inventory->removeAllViewers();
|
||||
$this->inventory = null;
|
||||
|
||||
parent::close();
|
||||
}
|
||||
|
@ -108,8 +108,6 @@ class Chest extends Spawnable implements Container, Nameable{
|
||||
$this->doubleInventory = null;
|
||||
}
|
||||
|
||||
$this->inventory = null;
|
||||
|
||||
parent::close();
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +98,6 @@ class Furnace extends Spawnable implements Container, Nameable{
|
||||
public function close() : void{
|
||||
if(!$this->closed){
|
||||
$this->inventory->removeAllViewers();
|
||||
$this->inventory = null;
|
||||
|
||||
parent::close();
|
||||
}
|
||||
|
@ -63,7 +63,6 @@ class Hopper extends Spawnable implements Container, Nameable{
|
||||
public function close() : void{
|
||||
if(!$this->closed){
|
||||
$this->inventory->removeAllViewers();
|
||||
$this->inventory = null;
|
||||
|
||||
parent::close();
|
||||
}
|
||||
|
@ -134,7 +134,6 @@ abstract class Tile{
|
||||
if($this->pos->isValid()){
|
||||
$this->pos->getWorld()->removeTile($this);
|
||||
}
|
||||
$this->pos = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1587,7 +1587,6 @@ abstract class Entity{
|
||||
* It is expected that the object is unusable after this is called.
|
||||
*/
|
||||
protected function destroyCycles() : void{
|
||||
$this->location = null;
|
||||
$this->lastDamageCause = null;
|
||||
}
|
||||
|
||||
|
@ -521,7 +521,6 @@ class World implements ChunkManager{
|
||||
$this->unregisterGenerator();
|
||||
|
||||
$this->provider->close();
|
||||
$this->provider = null;
|
||||
$this->blockCache = [];
|
||||
|
||||
$this->unloaded = true;
|
||||
|
@ -1,40 +1,5 @@
|
||||
parameters:
|
||||
ignoreErrors:
|
||||
-
|
||||
message: "#^Property pocketmine\\\\block\\\\tile\\\\Barrel\\:\\:\\$inventory \\(pocketmine\\\\block\\\\inventory\\\\BarrelInventory\\) does not accept null\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/block/tile/Barrel.php
|
||||
|
||||
-
|
||||
message: "#^Property pocketmine\\\\block\\\\tile\\\\BrewingStand\\:\\:\\$inventory \\(pocketmine\\\\block\\\\inventory\\\\BrewingStandInventory\\) does not accept null\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/block/tile/BrewingStand.php
|
||||
|
||||
-
|
||||
message: "#^Property pocketmine\\\\block\\\\tile\\\\Chest\\:\\:\\$inventory \\(pocketmine\\\\block\\\\inventory\\\\ChestInventory\\) does not accept null\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/block/tile/Chest.php
|
||||
|
||||
-
|
||||
message: "#^Property pocketmine\\\\block\\\\tile\\\\Furnace\\:\\:\\$inventory \\(pocketmine\\\\block\\\\inventory\\\\FurnaceInventory\\) does not accept null\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/block/tile/Furnace.php
|
||||
|
||||
-
|
||||
message: "#^Property pocketmine\\\\block\\\\tile\\\\Hopper\\:\\:\\$inventory \\(pocketmine\\\\block\\\\inventory\\\\HopperInventory\\) does not accept null\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/block/tile/Hopper.php
|
||||
|
||||
-
|
||||
message: "#^Property pocketmine\\\\block\\\\tile\\\\Tile\\:\\:\\$pos \\(pocketmine\\\\world\\\\Position\\) does not accept null\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/block/tile/Tile.php
|
||||
|
||||
-
|
||||
message: "#^Property pocketmine\\\\entity\\\\Entity\\:\\:\\$location \\(pocketmine\\\\entity\\\\Location\\) does not accept null\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/entity/Entity.php
|
||||
|
||||
-
|
||||
message: "#^Property pocketmine\\\\entity\\\\Human\\:\\:\\$enderInventory \\(pocketmine\\\\inventory\\\\PlayerEnderInventory\\) does not accept null\\.$#"
|
||||
count: 1
|
||||
@ -80,8 +45,3 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/player/Player.php
|
||||
|
||||
-
|
||||
message: "#^Property pocketmine\\\\world\\\\World\\:\\:\\$provider \\(pocketmine\\\\world\\\\format\\\\io\\\\WritableWorldProvider\\) does not accept null\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/world/World.php
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user