Fixed segfault on exit in case of chunk loaders are busy

This commit is contained in:
MihailRis 2022-03-08 20:36:11 +03:00 committed by GitHub
parent 4661ace697
commit e5fd0582d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,8 @@ Chunks::Chunks(int w, int h, int d, int ox, int oy, int oz) : w(w), h(h), d(d),
Chunks::~Chunks(){
for (size_t i = 0; i < volume; i++){
delete chunks[i];
if (chunks[i])
chunks[i]->decref();
}
delete[] chunks;
}