From 166717d6016e1c04f826caf71a37fe45dc8a50dd Mon Sep 17 00:00:00 2001 From: "florent.teppe" Date: Sat, 13 Aug 2022 00:34:01 +0200 Subject: [PATCH] Makes sure threads are only stopped once ,and that they will be re-started --- components/shader/shadermanager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/shader/shadermanager.cpp b/components/shader/shadermanager.cpp index 64b734f526..04b48ea4b4 100644 --- a/components/shader/shadermanager.cpp +++ b/components/shader/shadermanager.cpp @@ -406,9 +406,12 @@ namespace Shader std::filesystem::file_time_type write_time = std::filesystem::last_write_time(pathShaderToTest); if (write_time.time_since_epoch() > mLastAutoRecompileTime.time_since_epoch()) { - threadsRunningTostop = viewer.areThreadsRunning(); - if (threadsRunningTostop) - viewer.stopThreading(); + if (!threadsRunningTostop) + { + threadsRunningTostop = viewer.areThreadsRunning(); + if (threadsRunningTostop) + viewer.stopThreading(); + } for (const auto& [templateName, shaderDefines]: shaderKeys) {