Fixed memory leak issues on chunk generation under 32-bit hosts, fixed issue with generated chunks not having a provider. Closes #2419, fixes #2308, closes #2421

This commit is contained in:
Shoghi Cervantes 2014-12-28 02:19:46 +01:00
parent ab72c32769
commit 8d9fbec4ce
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89
2 changed files with 3 additions and 2 deletions

View File

@ -1755,6 +1755,7 @@ class Level implements ChunkManager, Metadatable{
public function generateChunkCallback($x, $z, FullChunk $chunk){
$oldChunk = $this->getChunk($x, $z, false);
unset($this->chunkGenerationQueue[Level::chunkHash($x, $z)]);
$chunk->setProvider($this->provider);
$this->setChunk($x, $z, $chunk);
if($chunk !== null and ($oldChunk === null or $oldChunk->isPopulated() === false) and $chunk->isPopulated()){
$this->server->getPluginManager()->callEvent(new ChunkPopulateEvent($chunk));

View File

@ -163,7 +163,7 @@ class GenerationChunkManager implements ChunkManager{
try{
$chunk = $this->getChunk($chunkX, $chunkZ);
$chunk->setGenerated(true);
$this->changes["$chunkX:$chunkZ"] = $chunk;
$this->changes[Level::chunkHash($chunkX, $chunkZ)] = $chunk;
}catch(\Exception $e){
}
}
@ -172,7 +172,7 @@ class GenerationChunkManager implements ChunkManager{
try{
$chunk = $this->getChunk($chunkX, $chunkZ);
$chunk->setPopulated(true);
$this->changes["$chunkX:$chunkZ"] = $chunk;
$this->changes[Level::chunkHash($chunkX, $chunkZ)] = $chunk;
}catch(\Exception $e){
}
}