Do not persist SimpleChunkManager between async tasks

this is just asking for memory leaks.
This commit is contained in:
Dylan K. Taylor
2020-12-03 19:46:23 +00:00
parent dde2e7e66f
commit 7edfa3713b
3 changed files with 7 additions and 13 deletions

View File

@ -78,7 +78,7 @@ class PopulationTask extends AsyncTask{
return;
}
$generator = $context->getGenerator();
$manager = $context->getChunkManager();
$manager = new SimpleChunkManager($context->getWorldHeight());
/** @var Chunk[] $chunks */
$chunks = [];
@ -124,8 +124,6 @@ class PopulationTask extends AsyncTask{
foreach($chunks as $i => $c){
$this->{"chunk$i"} = $c->isDirty() ? FastChunkSerializer::serializeWithoutLight($c) : null;
}
$manager->cleanChunks();
}
public function onCompletion() : void{