Added signal array memory deallocation

This commit is contained in:
Miroslav Bendík 2023-03-01 08:40:18 +01:00
parent b54e50ad6c
commit b3f50d3e14
1 changed files with 5 additions and 1 deletions

View File

@ -98,8 +98,12 @@ signal_disconnect(signal_array_t *arr, const char *name, const void *ref)
if(ref == *func)
{
cptr_array_remove(&sigfound->sigfuncs, func);
if(sigfound->sigfuncs.len == 0)
if(sigfound->sigfuncs.len == 0) {
if(sigfound->sigfuncs.tab) {
p_delete(&sigfound->sigfuncs.tab);
}
signal_array_remove(arr, sigfound);
}
return true;
}
}