summaryrefslogtreecommitdiff
path: root/lib/wireplumber/src/endpoint.c
diff options
context:
space:
mode:
authorkotontrion <[email protected]>2024-09-22 18:20:15 +0200
committerkotontrion <[email protected]>2024-09-22 18:20:15 +0200
commit8cab7d039e2cf783033a5f1f26cf8be42b0d158e (patch)
tree0758a687b02e90299182b365cc7da605a6ea7b66 /lib/wireplumber/src/endpoint.c
parent75057a2a8fec51b8dbf221f3121f3727de0680c1 (diff)
wireplumber: fix race condition
sometimes an endpoint gets added before the associated device. The creation of an endpoint is now delayed until the associated device is added.
Diffstat (limited to 'lib/wireplumber/src/endpoint.c')
-rw-r--r--lib/wireplumber/src/endpoint.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/wireplumber/src/endpoint.c b/lib/wireplumber/src/endpoint.c
index 9ae62e2..cf97a2a 100644
--- a/lib/wireplumber/src/endpoint.c
+++ b/lib/wireplumber/src/endpoint.c
@@ -345,7 +345,6 @@ static void astal_wp_endpoint_set_property(GObject *object, guint property_id, c
}
static void astal_wp_endpoint_update_properties(AstalWpEndpoint *self) {
-
AstalWpEndpointPrivate *priv = astal_wp_endpoint_get_instance_private(self);
if (priv->node == NULL) return;
self->id = wp_proxy_get_bound_id(WP_PROXY(priv->node));
@@ -426,7 +425,7 @@ static void astal_wp_endpoint_default_changed_as_default(AstalWpEndpoint *self)
g_type_class_unref(enum_class);
if (defaultId != self->id) {
- if (priv->node != NULL) g_object_unref(priv->node);
+ if (priv->node != NULL) g_clear_object(&priv->node);
AstalWpEndpoint *default_endpoint = astal_wp_wp_get_endpoint(priv->wp, defaultId);
if (default_endpoint != NULL &&
astal_wp_endpoint_get_media_class(default_endpoint) == priv->media_class) {