handle cleanup of remote proxies

Destroying a resource informs the client to destroy the proxy.
Destroying an object destroys all the bound resources on it.
This commit is contained in:
Wim Taymans 2016-12-02 17:14:32 +01:00
parent e6f45a7686
commit 5e8a3afe17
8 changed files with 38 additions and 4 deletions

View file

@ -892,6 +892,7 @@ pinos_link_destroy (PinosLink * this)
{
SpaResult res = SPA_RESULT_OK;
PinosLinkImpl *impl = SPA_CONTAINER_OF (this, PinosLinkImpl, this);
PinosResource *resource, *tmp;
pinos_log_debug ("link %p: destroy", impl);
pinos_signal_emit (&this->destroy_signal, this);
@ -899,6 +900,9 @@ pinos_link_destroy (PinosLink * this)
pinos_global_destroy (this->global);
spa_list_remove (&this->link);
spa_list_for_each_safe (resource, tmp, &this->resource_list, link)
pinos_resource_destroy (resource);
if (this->input) {
pinos_signal_remove (&impl->input_port_destroy);
pinos_signal_remove (&impl->input_async_complete);