Fix release fence in Singleton::Ref (GH #1208)

This commit is contained in:
Jeffrey Walton 2023-06-25 16:57:50 -04:00
parent e6f1f81319
commit a23f78d116
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

2
misc.h
View File

@ -346,8 +346,8 @@ template <class T, class F, int instance>
return *p;
T *newObject = m_objectFactory();
s_pObject.store(newObject, std::memory_order_relaxed);
std::atomic_thread_fence(std::memory_order_release);
s_pObject.store(newObject, std::memory_order_relaxed);
return *newObject;
#else