mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pipewire: improve memory cleanup
Add method to unload a spa interface. Various other memory cleanups
This commit is contained in:
parent
0dc036ac84
commit
d165b3b842
8 changed files with 362 additions and 80 deletions
|
|
@ -1084,6 +1084,10 @@ static int node_clear(struct node *this)
|
|||
{
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < this->n_params; i++)
|
||||
free(this->params[i]);
|
||||
free(this->params);
|
||||
|
||||
for (i = 0; i < MAX_INPUTS; i++) {
|
||||
if (this->in_ports[i].valid)
|
||||
clear_port(this, &this->in_ports[i], SPA_DIRECTION_INPUT, i);
|
||||
|
|
@ -1186,6 +1190,8 @@ static void node_free(void *data)
|
|||
if (impl->io_areas)
|
||||
pw_memblock_free(impl->io_areas);
|
||||
|
||||
pw_map_clear(&impl->io_map);
|
||||
|
||||
if (impl->fds[0] != -1)
|
||||
close(impl->fds[0]);
|
||||
if (impl->fds[1] != -1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue