diff options
Diffstat (limited to 'core/fxcrt/fx_basic_list.cpp')
-rw-r--r-- | core/fxcrt/fx_basic_list.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/fxcrt/fx_basic_list.cpp b/core/fxcrt/fx_basic_list.cpp index 02afd47112..f128176d00 100644 --- a/core/fxcrt/fx_basic_list.cpp +++ b/core/fxcrt/fx_basic_list.cpp @@ -73,12 +73,18 @@ void CFX_PtrList::FreeNode(CFX_PtrList::CNode* pNode) { RemoveAll(); } } + void CFX_PtrList::RemoveAll() { m_nCount = 0; - m_pNodeHead = m_pNodeTail = m_pNodeFree = NULL; - m_pBlocks->FreeDataChain(); - m_pBlocks = NULL; + m_pNodeHead = nullptr; + m_pNodeTail = nullptr; + m_pNodeFree = nullptr; + if (m_pBlocks) { + m_pBlocks->FreeDataChain(); + m_pBlocks = nullptr; + } } + CFX_PtrList::CNode* CFX_PtrList::NewNode(CFX_PtrList::CNode* pPrev, CFX_PtrList::CNode* pNext) { if (!m_pNodeFree) { |