Reference counting for Chunk | changed ChunksLoader
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user