mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-02 05:08:01 +02:00
modules: unregister the endpoints when their proxy is destroyed
This commit is contained in:
parent
922065f97d
commit
42bdf3ee6d
2 changed files with 28 additions and 0 deletions
|
|
@ -76,6 +76,16 @@ proxy_info_destroy(gpointer p)
|
|||
g_slice_free (struct proxy_info, p);
|
||||
}
|
||||
|
||||
static void
|
||||
unregister_endpoint (WpProxy* wp_proxy, WpEndpoint *endpoint)
|
||||
{
|
||||
g_return_if_fail(WP_IS_PROXY(wp_proxy));
|
||||
g_return_if_fail(WP_IS_ENDPOINT(endpoint));
|
||||
|
||||
/* Unregister the endpoint */
|
||||
wp_endpoint_unregister(endpoint);
|
||||
}
|
||||
|
||||
static void
|
||||
proxy_node_created(GObject *initable, GAsyncResult *res, gpointer d)
|
||||
{
|
||||
|
|
@ -123,6 +133,10 @@ proxy_node_created(GObject *initable, GAsyncResult *res, gpointer d)
|
|||
/* Register the endpoint */
|
||||
wp_endpoint_register (endpoint);
|
||||
|
||||
/* Set destroy handler to unregister endpoint when the proxy is detroyed */
|
||||
g_signal_connect (proxy_node, "destroyed", G_CALLBACK(unregister_endpoint),
|
||||
endpoint);
|
||||
|
||||
/* Clean up */
|
||||
proxy_info_destroy (pi);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,16 @@ proxy_info_destroy(gpointer p)
|
|||
g_slice_free (struct proxy_info, p);
|
||||
}
|
||||
|
||||
static void
|
||||
unregister_endpoint (WpProxy* wp_proxy, WpEndpoint *endpoint)
|
||||
{
|
||||
g_return_if_fail(WP_IS_PROXY(wp_proxy));
|
||||
g_return_if_fail(WP_IS_ENDPOINT(endpoint));
|
||||
|
||||
/* Unregister the endpoint */
|
||||
wp_endpoint_unregister(endpoint);
|
||||
}
|
||||
|
||||
static void
|
||||
proxy_node_created(GObject *initable, GAsyncResult *res, gpointer data)
|
||||
{
|
||||
|
|
@ -114,6 +124,10 @@ proxy_node_created(GObject *initable, GAsyncResult *res, gpointer data)
|
|||
/* Register the endpoint */
|
||||
wp_endpoint_register (endpoint);
|
||||
|
||||
/* Set destroy handler to unregister endpoint when the proxy is detroyed */
|
||||
g_signal_connect (proxy_node, "destroyed", G_CALLBACK(unregister_endpoint),
|
||||
endpoint);
|
||||
|
||||
/* Clean up */
|
||||
proxy_info_destroy (pi);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue