mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
AsyncWorker: added removeFromThreadStore()
and use it instead of overwriting with null things, which still occupies memory
This commit is contained in:
@@ -98,4 +98,13 @@ class AsyncWorker extends Worker{
|
||||
public function getFromThreadStore(string $identifier){
|
||||
return self::$store[$identifier] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes previously-stored mixed data from the worker's thread-local object store.
|
||||
*
|
||||
* @param string $identifier
|
||||
*/
|
||||
public function removeFromThreadStore(string $identifier) : void{
|
||||
unset(self::$store[$identifier]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user