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

@ -71,6 +71,15 @@ pinos_resource_destroy (PinosResource *resource)
if (resource->destroy)
resource->destroy (resource);
if (resource->client->core_resource) {
PinosMessageRemoveId m;
m.id = resource->id;
pinos_resource_send_message (resource->client->core_resource,
PINOS_MESSAGE_REMOVE_ID,
&m,
true);
}
pinos_main_loop_defer (resource->core->main_loop,
resource,
SPA_RESULT_WAIT_SYNC,