mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
AsyncTask: Remove cleanObject() and calls to it
This is no longer needed. Doing worker GC (via collect()) frees the allocated memory anyway, so this function is now redundant.
This commit is contained in:
parent
9014eb72e9
commit
18b287c3ea
@ -120,8 +120,6 @@ class AsyncPool{
|
||||
|
||||
unset($this->tasks[$task->getTaskId()]);
|
||||
unset($this->taskWorkers[$task->getTaskId()]);
|
||||
|
||||
$task->cleanObject();
|
||||
}
|
||||
|
||||
public function removeTasks(){
|
||||
|
@ -291,15 +291,5 @@ abstract class AsyncTask extends Collectable{
|
||||
|
||||
return $server->getScheduler()->peekLocalComplex($this);
|
||||
}
|
||||
|
||||
public function cleanObject(){
|
||||
foreach($this as $p => $v){
|
||||
if(!($v instanceof \Threaded)){
|
||||
$this->{$p} = null;
|
||||
}
|
||||
}
|
||||
|
||||
$this->setGarbage();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user