Skip to content

client-node: fix some fd / memblock leaks

P V requested to merge pvir/pipewire:memblock-leaks into master

client-node: handle releasing mix for destroyed port

The remote end may destroy the port via client_node_port_update(), before corresponding pw_impl_port_mix are released.

clear_port() removes all struct mix, but this prevents the pw_impl_port_mix from being removed from io_map, which causes stale mix ids be left in io_map, so we end up continuously allocating new io areas.

Make lifecycle of io_map entries match port_init_mix/release_mix exactly, separately from the lifecycle of the port and struct mix.

When freeing struct mix in port_release_mix(), make sure it corresponds to the mix being released.


client-node: clear buffers always when freeing mix

Avoid leaking buffers when freeing mix, in case the port was not cleared properly.

These leaks don't seem to be occurring currently, but better be sure.


There are memblock leaks left, e.g.:

  • something is leaking node activation record memblocks, it seems node_peer_added/removed for this->node activation record are not balanced. It's not clear it's actually leaking, as Pavucontrol seems to be creating an increasing number of monitor nodes, which the session manager neither links to anywhere nor requests to be destroyed. To be fixed later, maybe on SM side...
Edited by P V

Merge request reports