Merge pull request #3783 from mireq/fix-signal-memory-leak

Connect signal and disconnect signal leaks memory
This commit is contained in:
Aire-One 2023-05-03 19:14:14 +02:00 committed by GitHub
commit 6f000aad2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {
cptr_array_wipe(&sigfound->sigfuncs);
}
signal_array_remove(arr, sigfound);
}
return true;
}
}