detach memory pool list before freeing it

This commit is contained in:
PobreGato committed 2026-09-18 19:57:20 -04:00
1 parent 007d7a4357
commit 1c408f6086
1 file changed
+5 -1
+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>