From 8cab7d039e2cf783033a5f1f26cf8be42b0d158e Mon Sep 17 00:00:00 2001 From: kotontrion Date: Sun, 22 Sep 2024 18:20:15 +0200 Subject: 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. --- lib/wireplumber/src/endpoint.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/wireplumber/src/endpoint.c') 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) { -- cgit v1.2.3