mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
Reference counting for Chunk | changed ChunksLoader
This commit is contained in:
parent
bc9d29cf68
commit
4651ab776b
4 changed files with 18 additions and 12 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue