mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 15:48:01 +03:00
Fix potential leak memory for CRenderFxManager, CPointBaseCommand
CUtlVector::RemoveAll() doesn't free allocated memory
This commit is contained in:
parent
0bd5f7a0bb
commit
7420ba158a
@ -150,5 +150,5 @@ void CPointBaseCommand::OnDestroy()
|
||||
}
|
||||
}
|
||||
|
||||
m_vecCommands.RemoveAll();
|
||||
m_vecCommands.Purge();
|
||||
}
|
||||
|
@ -373,7 +373,7 @@ void CRenderFxManager::Spawn()
|
||||
|
||||
void CRenderFxManager::OnDestroy()
|
||||
{
|
||||
m_RenderGroups.RemoveAll();
|
||||
m_RenderGroups.Purge();
|
||||
}
|
||||
|
||||
void CRenderFxManager::Restart()
|
||||
|
@ -148,6 +148,7 @@ public:
|
||||
void RemoveAt(I i);
|
||||
bool Remove(T const &remove);
|
||||
void RemoveAll();
|
||||
void Purge();
|
||||
|
||||
// Allocation, deletion
|
||||
void FreeNode(I i);
|
||||
@ -848,6 +849,15 @@ void CUtlRBTree<T, I, L, M>::RemoveAll()
|
||||
m_NumElements = 0;
|
||||
}
|
||||
|
||||
template <class T, class I, typename L, class M>
|
||||
void CUtlRBTree<T, I, L, M>::Purge()
|
||||
{
|
||||
RemoveAll();
|
||||
m_FirstFree = InvalidIndex();
|
||||
m_TotalElements = 0;
|
||||
m_Elements.Purge();
|
||||
}
|
||||
|
||||
// Iteration
|
||||
template <class T, class I, typename L, class M>
|
||||
I CUtlRBTree<T, I, L, M>::FirstInorder() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user