mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
core: don't send remove_id in hello
The hello method should also destroy the resources for a client but not send a remove_id for them.
This commit is contained in:
parent
5d2f0f5182
commit
e0eeedc369
5 changed files with 14 additions and 5 deletions
|
|
@ -105,8 +105,10 @@ static const struct pw_resource_events resource_events = {
|
|||
static int destroy_resource(void *object, void *data)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
if (resource && resource != resource->client->core_resource)
|
||||
if (resource && resource != resource->client->core_resource) {
|
||||
resource->removed = true;
|
||||
pw_resource_destroy(resource);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,6 +117,9 @@ struct pw_core_proxy_methods {
|
|||
/**
|
||||
* Start a conversation with the server. This will send
|
||||
* the core info and server types.
|
||||
*
|
||||
* All the existing resources for the client (except the core
|
||||
* resource) will be destroyed.
|
||||
*/
|
||||
void (*hello) (void *object);
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -435,6 +435,8 @@ struct pw_resource {
|
|||
uint32_t type; /**< type of the client interface */
|
||||
uint32_t version; /**< version of the client interface */
|
||||
|
||||
bool removed; /**< if the resource was removed */
|
||||
|
||||
struct spa_hook implementation;
|
||||
struct spa_hook_list implementation_list;
|
||||
struct spa_hook_list listener_list;
|
||||
|
|
|
|||
|
|
@ -181,10 +181,12 @@ static void core_event_remove_id(void *data, uint32_t id)
|
|||
struct pw_proxy *proxy;
|
||||
|
||||
pw_log_debug("remote %p: object remove %u", this, id);
|
||||
if ((proxy = pw_map_lookup(&this->objects, id)) != NULL) {
|
||||
if ((proxy = pw_map_lookup(&this->objects, id)) == NULL) {
|
||||
pw_log_warn("remote %p: asked to remove unknown object id %u", this, id);
|
||||
return;
|
||||
}
|
||||
pw_proxy_destroy(proxy);
|
||||
pw_map_remove(&this->objects, id);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ void pw_resource_destroy(struct pw_resource *resource)
|
|||
pw_map_insert_at(&client->objects, resource->id, NULL);
|
||||
pw_client_events_resource_removed(client, resource);
|
||||
|
||||
if (client->core_resource)
|
||||
if (client->core_resource && !resource->removed)
|
||||
pw_core_resource_remove_id(client->core_resource, resource->id);
|
||||
|
||||
pw_log_debug("resource %p: free", resource);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue