mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Fix race when accessing std::locale::classic()
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78552
This commit is contained in:
parent
76fec09d87
commit
507145d785
@ -74,8 +74,9 @@ void MilliSleep(int64_t n)
|
|||||||
|
|
||||||
std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime)
|
std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime)
|
||||||
{
|
{
|
||||||
|
static std::locale classic(std::locale::classic());
|
||||||
// std::locale takes ownership of the pointer
|
// std::locale takes ownership of the pointer
|
||||||
std::locale loc(std::locale::classic(), new boost::posix_time::time_facet(pszFormat));
|
std::locale loc(classic, new boost::posix_time::time_facet(pszFormat));
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss.imbue(loc);
|
ss.imbue(loc);
|
||||||
ss << boost::posix_time::from_time_t(nTime);
|
ss << boost::posix_time::from_time_t(nTime);
|
||||||
|
Loading…
Reference in New Issue
Block a user