mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-20 13:54:14 +01:00
Attempt at fixing a small memory leaks in RemoveHookManager (hook handler delegates were not being deleted)
--HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40621
This commit is contained in:
parent
2ee096f5e7
commit
82ce7c9ada
@ -31,6 +31,7 @@ namespace SourceHook
|
||||
|
||||
// *** Interface ***
|
||||
inline CIface(void *ptr);
|
||||
inline ~CIface();
|
||||
inline bool operator==(const Descriptor &other);
|
||||
inline void *GetPtr() const;
|
||||
inline List<CHook> &GetPreHookList();
|
||||
@ -45,6 +46,20 @@ namespace SourceHook
|
||||
{
|
||||
}
|
||||
|
||||
inline CIface::~CIface()
|
||||
{
|
||||
// Before getting deleted, delete all remaining hook handlers
|
||||
for (List<CHook>::iterator iter = m_PreHooks.begin(); iter != m_PreHooks.end(); ++iter)
|
||||
{
|
||||
iter->GetHandler()->DeleteThis();
|
||||
}
|
||||
|
||||
for (List<CHook>::iterator iter = m_PostHooks.begin(); iter != m_PostHooks.end(); ++iter)
|
||||
{
|
||||
iter->GetHandler()->DeleteThis();
|
||||
}
|
||||
}
|
||||
|
||||
inline bool CIface::operator==(const Descriptor &other)
|
||||
{
|
||||
return m_Ptr == other;
|
||||
|
Loading…
x
Reference in New Issue
Block a user