mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-09 11:31:49 +00:00
Level: don't try to unregister generators from non-live workers
this was causing garbage-collected workers to get restarted on shutdown if they previously had the generator registered for that level.
This commit is contained in:
parent
706c620d04
commit
24f11779f2
@ -383,8 +383,10 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
|
|
||||||
public function unregisterGenerator(){
|
public function unregisterGenerator(){
|
||||||
$pool = $this->server->getAsyncPool();
|
$pool = $this->server->getAsyncPool();
|
||||||
foreach($this->generatorRegisteredWorkers as $i => $bool){
|
foreach($pool->getRunningWorkers() as $i){
|
||||||
$pool->submitTaskToWorker(new GeneratorUnregisterTask($this), $i);
|
if(isset($this->generatorRegisteredWorkers[$i])){
|
||||||
|
$pool->submitTaskToWorker(new GeneratorUnregisterTask($this), $i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->generatorRegisteredWorkers = [];
|
$this->generatorRegisteredWorkers = [];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user