[Fix] Hook memleak.
This commit is contained in:
parent
eba65cf358
commit
34dccfb646
@ -94,14 +94,17 @@ void hook_rm(unsigned int id) {
|
|||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Mark to delete, but do not delete yet, hooks are running. */
|
||||||
if(hook_runningstack) {
|
if(hook_runningstack) {
|
||||||
hook_stack[m].delete = 1;
|
hook_stack[m].delete = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Free the hook. */
|
||||||
|
hook_free(&hook_stack[m]);
|
||||||
|
|
||||||
/* Last hook, just clip the stack. */
|
/* Last hook, just clip the stack. */
|
||||||
if(m == (hook_nstack-1)) {
|
if(m == (hook_nstack-1)) {
|
||||||
hook_free(&hook_stack[m]);
|
|
||||||
hook_nstack--;
|
hook_nstack--;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user