Fix crash on close.

This commit is contained in:
IntegratedQuantum 2022-11-10 19:54:16 +01:00
parent 28cb01353a
commit cbf784d1e9
2 changed files with 2 additions and 0 deletions

View File

@ -838,6 +838,7 @@ pub const RenderStructure = struct {
}
pub fn deinit() void {
main.threadPool.clear();
for(storageLists) |storageList| {
for(storageList) |nullChunkMesh| {
if(nullChunkMesh) |chunkMesh| {

View File

@ -316,6 +316,7 @@ pub const ThreadPool = struct {
for(self.loadList.array[0..self.loadList.size]) |task| {
task.vtable.clean(task.self);
}
self.loadList.size = 0;
self.loadList.mutex.unlock();
// Wait for the in-progress tasks to finish:
while(true) {