mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-19 10:08:04 +03:00
Fix: bug with removeHook not erases address callback
This commit is contained in:
parent
056b02ad5e
commit
b64a4f6c84
@ -39,7 +39,12 @@ void AbstractHookChainRegistry::removeHook(void* hookFunc) {
|
|||||||
for (int i = 0; i < m_NumHooks; i++) {
|
for (int i = 0; i < m_NumHooks; i++) {
|
||||||
if (hookFunc == m_Hooks[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]));
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user