mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
Work on cleanup
Add signal handlers for daemon to shut down Add destroy listeners for modules and do cleanup Fix some leaks Simplify port registration in new nodes Hide some more data structures Let the node implementation take care of the reuse_buffer signal because then we can get to the graph nodes to find the destination port. Destroy modules in core cleanup. Modules should undo everything they have done. Activate the link after we negotiated format and buffers.
This commit is contained in:
parent
12e2fae8ab
commit
c25834a692
31 changed files with 586 additions and 344 deletions
|
|
@ -563,8 +563,10 @@ static void source_signal_func(struct spa_source *source)
|
|||
{
|
||||
struct source_impl *impl = SPA_CONTAINER_OF(source, struct source_impl, source);
|
||||
struct signalfd_siginfo signal_info;
|
||||
int len;
|
||||
|
||||
if (read(source->fd, &signal_info, sizeof(signal_info)) != sizeof(signal_info))
|
||||
len = read(source->fd, &signal_info, sizeof signal_info);
|
||||
if (!(len == -1 && errno == EAGAIN) && len != sizeof signal_info)
|
||||
spa_log_warn(impl->impl->log, NAME " %p: failed to read signal fd %d: %s",
|
||||
source, source->fd, strerror(errno));
|
||||
|
||||
|
|
@ -586,10 +588,12 @@ static struct spa_source *loop_add_signal(struct spa_loop_utils *utils,
|
|||
source->source.loop = &impl->loop;
|
||||
source->source.func = source_signal_func;
|
||||
source->source.data = data;
|
||||
|
||||
sigemptyset(&mask);
|
||||
sigaddset(&mask, signal_number);
|
||||
source->source.fd = signalfd(-1, &mask, SFD_CLOEXEC | SFD_NONBLOCK);
|
||||
sigprocmask(SIG_BLOCK, &mask, NULL);
|
||||
|
||||
source->source.mask = SPA_IO_IN;
|
||||
source->impl = impl;
|
||||
source->close = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue