mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-18 07:00:06 -05:00
Work on async cleanup
Track all async changes and only perform free of resources when all previous async operations completed.
This commit is contained in:
parent
7ecfc28d0f
commit
1d61fd3696
19 changed files with 270 additions and 130 deletions
|
|
@ -54,6 +54,17 @@ pinos_port_new (PinosNode *node,
|
|||
return this;
|
||||
}
|
||||
|
||||
static void
|
||||
sync_destroy (void *object,
|
||||
void *data,
|
||||
SpaResult res,
|
||||
uint32_t id)
|
||||
{
|
||||
PinosPort *port = object;
|
||||
|
||||
free (port);
|
||||
}
|
||||
|
||||
void
|
||||
pinos_port_destroy (PinosPort *port)
|
||||
{
|
||||
|
|
@ -61,6 +72,8 @@ pinos_port_destroy (PinosPort *port)
|
|||
|
||||
pinos_signal_emit (&port->destroy_signal, port);
|
||||
|
||||
spa_list_remove (&port->link);
|
||||
|
||||
spa_node_port_use_buffers (port->node->node,
|
||||
port->direction,
|
||||
port->port_id,
|
||||
|
|
@ -68,8 +81,11 @@ pinos_port_destroy (PinosPort *port)
|
|||
port->buffers = NULL;
|
||||
port->n_buffers = 0;
|
||||
|
||||
spa_list_remove (&port->link);
|
||||
free (port);
|
||||
pinos_main_loop_defer (port->node->core->main_loop,
|
||||
port,
|
||||
SPA_RESULT_WAIT_SYNC,
|
||||
sync_destroy,
|
||||
port);
|
||||
}
|
||||
|
||||
static SpaResult
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue