mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-01 01:25:38 +03:00
Merge pull request #98 from s1lentq/master
Fix: bug with removeHook not erases address callback
This commit is contained in:
commit
e7d62603ae
@ -38,8 +38,13 @@ void AbstractHookChainRegistry::removeHook(void* hookFunc) {
|
||||
// erase hook
|
||||
for (int i = 0; i < m_NumHooks; i++) {
|
||||
if (hookFunc == m_Hooks[i]) {
|
||||
if(--m_NumHooks != i)
|
||||
if (--m_NumHooks != i)
|
||||
{
|
||||
Q_memmove(&m_Hooks[i], &m_Hooks[i + 1], (m_NumHooks - i) * sizeof(m_Hooks[0]));
|
||||
m_Hooks[m_NumHooks] = NULL;
|
||||
}
|
||||
else
|
||||
m_Hooks[i] = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user