Fix: added 'static' to thread_local variable in chaiscript/chaiscript_threading.hpp

Because it's a singleton and should be one instance per thread, without it will be singleton per call,
also it won't compile on VS2017 15.8.9
The error:
chaiscript\include\chaiscript\chaiscript_threading.hpp(107): error C2480: 'my_t': 'thread' is only valid for data items of static extent
This commit is contained in:
Yuri Yaryshev 2018-11-15 18:59:18 +03:00
parent 8d0fc74341
commit 7a67963ca7

View File

@ -107,7 +107,7 @@ namespace chaiscript
/// does there is no possible way to recover
static std::unordered_map<const void*, T> &t() noexcept
{
thread_local std::unordered_map<const void *, T> my_t;
static thread_local std::unordered_map<const void *, T> my_t;
return my_t;
}
};