Merge pull request #2565 from pobregat0/pool-cleanup-order

detach memory pool list before freeing it
This commit is contained in:
orignal
2026-09-18 22:27:03 -04:00
committed by GitHub
+5 -1
View File
@@ -60,8 +60,12 @@ namespace util
void CleanUp ()
{
CleanUp (m_Head);
// detach the list first: while it is being freed m_Head would point
// to already deleted memory, and Acquire or Release from another
// thread reads or writes it
auto head = m_Head;
m_Head = nullptr;
CleanUp (head);
}
template<typename... TArgs>