Skip to content

Commit

Permalink
Fix release fence in Singleton::Ref (GH #1208)
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Jun 25, 2023
1 parent e6f1f81 commit a23f78d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a23f78d

Please sign in to comment.