From eb71cf0ae89e901c45cda4b7facf1d867d5715d5 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Tue, 30 May 2017 23:24:55 +0200 Subject: [PATCH] [Node] Fix sync nodes lag --- src/Components/Modules/Node.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Components/Modules/Node.cpp b/src/Components/Modules/Node.cpp index 114e4471..7c192e91 100644 --- a/src/Components/Modules/Node.cpp +++ b/src/Components/Modules/Node.cpp @@ -872,7 +872,17 @@ namespace Components { Logger::Print("Resynchronizing nodes...\n"); - Node::LoadNodeRemotePreset(); + static bool threadRunning = false; + + if (!threadRunning) + { + threadRunning = true; + std::thread([]() + { + Node::LoadNodeRemotePreset(); + threadRunning = false; + }).detach(); + } std::lock_guard _(Node::NodeMutex); for (auto& node : Node::Nodes)