Fix deadlock caused by read locks not being released

This commit is contained in:
Marc Gilleron 2021-12-23 23:55:43 +01:00
parent c2b0884126
commit 79d4223be4

View File

@ -619,7 +619,6 @@ VoxelSingleValue VoxelLodTerrain::get_voxel(Vector3i pos, unsigned int channel,
Vector3i voxel_pos = pos;
for (unsigned int lod_index = 0; lod_index < _lod_count; ++lod_index) {
const VoxelDataLodMap::Lod &data_lod = _data->lods[lod_index];
data_lod.map_lock.read_lock();
std::shared_ptr<VoxelBufferInternal> voxels = try_get_voxel_buffer_with_lock(data_lod, block_pos);
if (voxels != nullptr) {
return get_voxel_with_lock(*voxels, data_lod.map.to_local(voxel_pos), channel);