mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-23 02:11:43 +00:00
detach memory pool list before freeing it
This commit is contained in:
1 parent
007d7a4357
commit
1c408f6086
1 file changed
+5
-1
+5
-1
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user