mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-14 06:59:57 -05:00
Return -EEXIST when registering an object twice
This commit is contained in:
parent
fbf6acd271
commit
f57a806cf8
4 changed files with 10 additions and 0 deletions
|
|
@ -311,6 +311,9 @@ int pw_client_register(struct pw_client *client,
|
|||
{
|
||||
struct pw_core *core = client->core;
|
||||
|
||||
if (client->registered)
|
||||
return -EEXIST;
|
||||
|
||||
pw_log_debug("client %p: register parent %d", client, parent ? parent->id : SPA_ID_INVALID);
|
||||
|
||||
spa_list_append(&core->client_list, &client->link);
|
||||
|
|
|
|||
|
|
@ -146,6 +146,9 @@ int pw_factory_register(struct pw_factory *factory,
|
|||
{
|
||||
struct pw_core *core = factory->core;
|
||||
|
||||
if (factory->registered)
|
||||
return -EEXIST;
|
||||
|
||||
if (properties == NULL)
|
||||
properties = pw_properties_new(NULL, NULL);
|
||||
if (properties == NULL)
|
||||
|
|
|
|||
|
|
@ -1394,6 +1394,9 @@ int pw_link_register(struct pw_link *link,
|
|||
struct pw_core *core = link->core;
|
||||
struct pw_node *input_node, *output_node;
|
||||
|
||||
if (link->registered)
|
||||
return -EEXIST;
|
||||
|
||||
if (properties == NULL)
|
||||
properties = pw_properties_new(NULL, NULL);
|
||||
if (properties == NULL)
|
||||
|
|
|
|||
|
|
@ -785,6 +785,7 @@ static void pw_port_remove(struct pw_port *port)
|
|||
}
|
||||
spa_list_remove(&port->link);
|
||||
pw_node_emit_port_removed(node, port);
|
||||
port->node = NULL;
|
||||
}
|
||||
|
||||
void pw_port_destroy(struct pw_port *port)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue