[Node] Fix sync nodes lag

This commit is contained in:
momo5502 2017-05-30 23:24:55 +02:00
parent 991056b362
commit eb71cf0ae8

View File

@ -872,7 +872,17 @@ namespace Components
{ {
Logger::Print("Resynchronizing nodes...\n"); 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<std::recursive_mutex> _(Node::NodeMutex); std::lock_guard<std::recursive_mutex> _(Node::NodeMutex);
for (auto& node : Node::Nodes) for (auto& node : Node::Nodes)