Fix ignored return value warning

warning: ignoring return value of ‘std::lock_guard<_Mutex>::lock_guard(mutex_type&) [with _Mutex = std::mutex; mutex_type = std::mutex]’, declared with attribute ‘nodiscard’ [-Wunused-result]

This may mean the lock wasn't actually being taken.
This commit is contained in:
Dale Glass 2024-05-04 16:15:09 +02:00
parent 9cb35541d3
commit 84b16f44aa

View file

@ -64,7 +64,7 @@ void LODManager::setRenderTimes(float presentTime, float engineRunTime, float ba
} }
void LODManager::autoAdjustLOD(float realTimeDelta) { void LODManager::autoAdjustLOD(float realTimeDelta) {
std::lock_guard<std::mutex> { _automaticLODLock }; std::lock_guard<std::mutex> lock{ _automaticLODLock };
// The "render time" is the worse of: // The "render time" is the worse of:
// - engineRunTime: Time spent in the render thread in the engine producing the gpu::Frame N // - engineRunTime: Time spent in the render thread in the engine producing the gpu::Frame N
@ -300,7 +300,7 @@ void LODManager::resetLODAdjust() {
} }
void LODManager::setAutomaticLODAdjust(bool value) { void LODManager::setAutomaticLODAdjust(bool value) {
std::lock_guard<std::mutex> { _automaticLODLock }; std::lock_guard<std::mutex> lock{ _automaticLODLock };
_automaticLODAdjust = value; _automaticLODAdjust = value;
saveSettings(); saveSettings();
emit autoLODChanged(); emit autoLODChanged();