Reference counting for Chunk | changed ChunksLoader

This commit is contained in:
MihailRis 2022-02-28 03:56:02 +03:00 • committed by GitHub
parent bc9d29cf68
commit 4651ab776b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 12 deletions

View file

@ -35,3 +35,12 @@ Chunk* Chunk::clone() const {
other->lightmap->set(lightmap);
return other;
}
void Chunk::incref(){
references++;
}
void Chunk::decref(){
if (--references <= 0)
delete this;
}