eloop: fix memory leak for shared signals
A shared signal owns an eloop_fd object. This has a reference of its connected eloop. Therefore, we must free a shared signal to drop a reference to the connected eloop and cannot postpone this to eloop-destruction. Otherwise, the eloop will never get destroyed. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
e302a0bd96
commit
2010d661dd
@ -578,6 +578,8 @@ void ev_eloop_unregister_signal_cb(struct ev_eloop *loop, int signum,
|
||||
sig = kmscon_dlist_entry(iter, struct ev_signal_shared, list);
|
||||
if (sig->signum == signum) {
|
||||
kmscon_hook_rm_cast(sig->hook, cb, data);
|
||||
if (!kmscon_hook_num(sig->hook))
|
||||
signal_free(sig);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user