diff --git a/interface/src/LODManager.cpp b/interface/src/LODManager.cpp index 2cba5f9b1b..2973208fef 100644 --- a/interface/src/LODManager.cpp +++ b/interface/src/LODManager.cpp @@ -54,6 +54,7 @@ void LODManager::setRenderTimes(float presentTime, float engineRunTime, float ba } void LODManager::autoAdjustLOD(float realTimeDelta) { + std::lock_guard { _automaticLODLock }; // The "render time" is the worse of: // - engineRunTime: Time spent in the render thread in the engine producing the gpu::Frame N @@ -235,6 +236,7 @@ void LODManager::resetLODAdjust() { } void LODManager::setAutomaticLODAdjust(bool value) { + std::lock_guard { _automaticLODLock }; _automaticLODAdjust = value; emit autoLODChanged(); } diff --git a/interface/src/LODManager.h b/interface/src/LODManager.h index 6fd9904906..8fd39e7161 100644 --- a/interface/src/LODManager.h +++ b/interface/src/LODManager.h @@ -12,6 +12,8 @@ #ifndef hifi_LODManager_h #define hifi_LODManager_h +#include + #include #include #include @@ -230,6 +232,7 @@ signals: private: LODManager(); + std::mutex _automaticLODLock; bool _automaticLODAdjust = true; float _presentTime{ 0.0f }; // msec