Commit 58db9e1f authored by Julian Bouzas's avatar Julian Bouzas
Browse files

global-proxy: destroy the global when proxy is destroyed

parent d8ed6e43
Pipeline #318255 passed with stages
in 53 seconds
......@@ -75,6 +75,14 @@ wp_client_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
client, &client_events);
}
static void
wp_client_pw_proxy_destroyed (WpProxy * proxy)
{
wp_pw_object_mixin_handle_pw_proxy_destroyed (proxy);
WP_PROXY_CLASS (wp_client_parent_class)->pw_proxy_destroyed (proxy);
}
static void
wp_client_class_init (WpClientClass * klass)
{
......@@ -93,8 +101,7 @@ wp_client_class_init (WpClientClass * klass)
proxy_class->pw_iface_type = PW_TYPE_INTERFACE_Client;
proxy_class->pw_iface_version = PW_VERSION_CLIENT;
proxy_class->pw_proxy_created = wp_client_pw_proxy_created;
proxy_class->pw_proxy_destroyed =
wp_pw_object_mixin_handle_pw_proxy_destroyed;
proxy_class->pw_proxy_destroyed = wp_client_pw_proxy_destroyed;
wp_pw_object_mixin_class_override_properties (object_class);
}
......
......@@ -99,6 +99,14 @@ wp_device_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
device, &device_events);
}
static void
wp_device_pw_proxy_destroyed (WpProxy * proxy)
{
wp_pw_object_mixin_handle_pw_proxy_destroyed (proxy);
WP_PROXY_CLASS (wp_device_parent_class)->pw_proxy_destroyed (proxy);
}
static void
wp_device_class_init (WpDeviceClass * klass)
{
......@@ -118,8 +126,7 @@ wp_device_class_init (WpDeviceClass * klass)
proxy_class->pw_iface_type = PW_TYPE_INTERFACE_Device;
proxy_class->pw_iface_version = PW_VERSION_DEVICE;
proxy_class->pw_proxy_created = wp_device_pw_proxy_created;
proxy_class->pw_proxy_destroyed =
wp_pw_object_mixin_handle_pw_proxy_destroyed;
proxy_class->pw_proxy_destroyed = wp_device_pw_proxy_destroyed;
wp_pw_object_mixin_class_override_properties (object_class);
}
......
......@@ -98,6 +98,14 @@ wp_endpoint_link_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
endpoint_link, &endpoint_link_events);
}
static void
wp_endpoint_link_pw_proxy_destroyed (WpProxy * proxy)
{
wp_pw_object_mixin_handle_pw_proxy_destroyed (proxy);
WP_PROXY_CLASS (wp_endpoint_link_parent_class)->pw_proxy_destroyed (proxy);
}
static void
wp_endpoint_link_class_init (WpEndpointLinkClass * klass)
{
......@@ -118,8 +126,7 @@ wp_endpoint_link_class_init (WpEndpointLinkClass * klass)
proxy_class->pw_iface_type = PW_TYPE_INTERFACE_EndpointLink;
proxy_class->pw_iface_version = PW_VERSION_ENDPOINT_LINK;
proxy_class->pw_proxy_created = wp_endpoint_link_pw_proxy_created;
proxy_class->pw_proxy_destroyed =
wp_pw_object_mixin_handle_pw_proxy_destroyed;
proxy_class->pw_proxy_destroyed = wp_endpoint_link_pw_proxy_destroyed;
wp_pw_object_mixin_class_override_properties (object_class);
......
......@@ -140,6 +140,14 @@ wp_endpoint_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
endpoint, &endpoint_events);
}
static void
wp_endpoint_pw_proxy_destroyed (WpProxy * proxy)
{
wp_pw_object_mixin_handle_pw_proxy_destroyed (proxy);
WP_PROXY_CLASS (wp_endpoint_parent_class)->pw_proxy_destroyed (proxy);
}
static void
wp_endpoint_class_init (WpEndpointClass * klass)
{
......@@ -158,8 +166,7 @@ wp_endpoint_class_init (WpEndpointClass * klass)
proxy_class->pw_iface_type = PW_TYPE_INTERFACE_Endpoint;
proxy_class->pw_iface_version = PW_VERSION_ENDPOINT;
proxy_class->pw_proxy_created = wp_endpoint_pw_proxy_created;
proxy_class->pw_proxy_destroyed =
wp_pw_object_mixin_handle_pw_proxy_destroyed;
proxy_class->pw_proxy_destroyed = wp_endpoint_pw_proxy_destroyed;
wp_pw_object_mixin_class_override_properties (object_class);
......
......@@ -168,6 +168,16 @@ wp_global_proxy_bound (WpProxy * proxy, guint32 global_id)
}
}
static void
wp_global_proxy_destroyed (WpProxy * proxy)
{
WpGlobalProxy *self = WP_GLOBAL_PROXY (proxy);
WpGlobalProxyPrivate *priv =
wp_global_proxy_get_instance_private (self);
g_clear_pointer (&priv->global, wp_global_unref);
}
static void
wp_global_proxy_class_init (WpGlobalProxyClass * klass)
{
......@@ -188,6 +198,7 @@ wp_global_proxy_class_init (WpGlobalProxyClass * klass)
wp_global_proxy_activate_execute_step;
proxy_class->bound = wp_global_proxy_bound;
proxy_class->pw_proxy_destroyed = wp_global_proxy_destroyed;
g_object_class_install_property (object_class, PROP_GLOBAL,
g_param_spec_boxed ("global", "global", "Internal WpGlobal object",
......
......@@ -79,6 +79,14 @@ wp_link_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
link, &link_events);
}
static void
wp_link_pw_proxy_destroyed (WpProxy * proxy)
{
wp_pw_object_mixin_handle_pw_proxy_destroyed (proxy);
WP_PROXY_CLASS (wp_link_parent_class)->pw_proxy_destroyed (proxy);
}
static void
wp_link_class_init (WpLinkClass * klass)
{
......@@ -97,8 +105,7 @@ wp_link_class_init (WpLinkClass * klass)
proxy_class->pw_iface_type = PW_TYPE_INTERFACE_Link;
proxy_class->pw_iface_version = PW_VERSION_LINK;
proxy_class->pw_proxy_created = wp_link_pw_proxy_created;
proxy_class->pw_proxy_destroyed =
wp_pw_object_mixin_handle_pw_proxy_destroyed;
proxy_class->pw_proxy_destroyed = wp_link_pw_proxy_destroyed;
wp_pw_object_mixin_class_override_properties (object_class);
}
......
......@@ -263,6 +263,8 @@ wp_metadata_pw_proxy_destroyed (WpProxy * proxy)
clear_items (&priv->metadata);
wp_object_update_features (WP_OBJECT (self), 0, WP_METADATA_FEATURE_DATA);
WP_PROXY_CLASS (wp_metadata_parent_class)->pw_proxy_destroyed (proxy);
}
static void
......
......@@ -172,6 +172,8 @@ wp_node_pw_proxy_destroyed (WpProxy * proxy)
g_clear_object (&self->ports_om);
wp_object_update_features (WP_OBJECT (self), 0, WP_NODE_FEATURE_PORTS);
WP_PROXY_CLASS (wp_node_parent_class)->pw_proxy_destroyed (proxy);
}
static void
......
......@@ -87,6 +87,14 @@ wp_port_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
port, &port_events);
}
static void
wp_port_pw_proxy_destroyed (WpProxy * proxy)
{
wp_pw_object_mixin_handle_pw_proxy_destroyed (proxy);
WP_PROXY_CLASS (wp_port_parent_class)->pw_proxy_destroyed (proxy);
}
static void
wp_port_class_init (WpPortClass * klass)
{
......@@ -106,8 +114,7 @@ wp_port_class_init (WpPortClass * klass)
proxy_class->pw_iface_type = PW_TYPE_INTERFACE_Port;
proxy_class->pw_iface_version = PW_VERSION_PORT;
proxy_class->pw_proxy_created = wp_port_pw_proxy_created;
proxy_class->pw_proxy_destroyed =
wp_pw_object_mixin_handle_pw_proxy_destroyed;
proxy_class->pw_proxy_destroyed = wp_port_pw_proxy_destroyed;
wp_pw_object_mixin_class_override_properties (object_class);
}
......
......@@ -237,6 +237,8 @@ wp_session_pw_proxy_destroyed (WpProxy * proxy)
wp_object_update_features (WP_OBJECT (self), 0,
WP_SESSION_FEATURE_ENDPOINTS |
WP_SESSION_FEATURE_LINKS);
WP_PROXY_CLASS (wp_session_parent_class)->pw_proxy_destroyed (proxy);
}
static void
......
......@@ -158,8 +158,6 @@ si_audio_endpoint_disable_active (WpSessionItem *si)
{
WpSiAudioEndpoint *self = WP_SI_AUDIO_ENDPOINT (si);
if (self->node)
wp_object_deactivate (WP_OBJECT (self->node), WP_OBJECT_FEATURES_ALL);
g_clear_object (&self->node);
wp_object_update_features (WP_OBJECT (self), 0,
WP_SESSION_ITEM_FEATURE_ACTIVE);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment