mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-13 23:28:04 +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()
|
||||
@ -1837,7 +1837,7 @@ bool CBombTarget::IsPlayerInBombSite(CBasePlayer *pPlayer)
|
||||
{
|
||||
const Vector &absmin = pPlayer->pev->absmin;
|
||||
const Vector &absmax = pPlayer->pev->absmax;
|
||||
|
||||
|
||||
// Ensure that player's body is inside func_bomb_target's X,Y axes.
|
||||
if (pev->absmin.x > absmin.x || pev->absmin.y > absmin.y)
|
||||
{
|
||||
@ -1847,7 +1847,7 @@ bool CBombTarget::IsPlayerInBombSite(CBasePlayer *pPlayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -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