mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
NOTE! THIS SHOULD BE REVERTED LATER! Removed WeakRef dependency
This commit is contained in:
@ -29,7 +29,7 @@ use pocketmine\utils\PluginException;
|
||||
|
||||
abstract class MetadataStore{
|
||||
/** @var \WeakMap[] */
|
||||
private $metadataMap = [];
|
||||
private $metadataMap;
|
||||
|
||||
/**
|
||||
* Adds a metadata value to an object.
|
||||
@ -48,8 +48,8 @@ abstract class MetadataStore{
|
||||
|
||||
$key = $this->disambiguate($subject, $metadataKey);
|
||||
if(!isset($this->metadataMap[$key])){
|
||||
$entry = new \WeakMap();
|
||||
$this->metadataMap[$key] = $entry;
|
||||
//$entry = new \WeakMap();
|
||||
$this->metadataMap[$key] = new \SplObjectStorage();//$entry;
|
||||
}else{
|
||||
$entry = $this->metadataMap[$key];
|
||||
}
|
||||
|
@ -28,14 +28,14 @@ abstract class MetadataValue{
|
||||
private $owningPlugin;
|
||||
|
||||
protected function __construct(Plugin $owningPlugin){
|
||||
$this->owningPlugin = new \WeakRef($owningPlugin);
|
||||
$this->owningPlugin = $owningPlugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Plugin
|
||||
*/
|
||||
public function getOwningPlugin(){
|
||||
return $this->owningPlugin->get();
|
||||
return $this->owningPlugin;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user