mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-28 06: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()
|
void CRenderFxManager::OnDestroy()
|
||||||
{
|
{
|
||||||
m_RenderGroups.RemoveAll();
|
m_RenderGroups.Purge();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRenderFxManager::Restart()
|
void CRenderFxManager::Restart()
|
||||||
@ -1837,7 +1837,7 @@ bool CBombTarget::IsPlayerInBombSite(CBasePlayer *pPlayer)
|
|||||||
{
|
{
|
||||||
const Vector &absmin = pPlayer->pev->absmin;
|
const Vector &absmin = pPlayer->pev->absmin;
|
||||||
const Vector &absmax = pPlayer->pev->absmax;
|
const Vector &absmax = pPlayer->pev->absmax;
|
||||||
|
|
||||||
// Ensure that player's body is inside func_bomb_target's X,Y axes.
|
// 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)
|
if (pev->absmin.x > absmin.x || pev->absmin.y > absmin.y)
|
||||||
{
|
{
|
||||||
@ -1847,7 +1847,7 @@ bool CBombTarget::IsPlayerInBombSite(CBasePlayer *pPlayer)
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,6 +148,7 @@ public:
|
|||||||
void RemoveAt(I i);
|
void RemoveAt(I i);
|
||||||
bool Remove(T const &remove);
|
bool Remove(T const &remove);
|
||||||
void RemoveAll();
|
void RemoveAll();
|
||||||
|
void Purge();
|
||||||
|
|
||||||
// Allocation, deletion
|
// Allocation, deletion
|
||||||
void FreeNode(I i);
|
void FreeNode(I i);
|
||||||
@ -848,6 +849,15 @@ void CUtlRBTree<T, I, L, M>::RemoveAll()
|
|||||||
m_NumElements = 0;
|
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
|
// Iteration
|
||||||
template <class T, class I, typename L, class M>
|
template <class T, class I, typename L, class M>
|
||||||
I CUtlRBTree<T, I, L, M>::FirstInorder() const
|
I CUtlRBTree<T, I, L, M>::FirstInorder() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user