Merge pull request #3783 from mireq/fix-signal-memory-leak
Connect signal and disconnect signal leaks memory
This commit is contained in:
commit
6f000aad2a
|
@ -98,8 +98,12 @@ signal_disconnect(signal_array_t *arr, const char *name, const void *ref)
|
||||||
if(ref == *func)
|
if(ref == *func)
|
||||||
{
|
{
|
||||||
cptr_array_remove(&sigfound->sigfuncs, 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);
|
signal_array_remove(arr, sigfound);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue