mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-03 02:08:00 +02:00
modules: disconnect the signals when the endpoints are destroyed
This commit is contained in:
parent
7aded3a8c9
commit
3207811795
2 changed files with 20 additions and 9 deletions
|
|
@ -33,6 +33,9 @@ struct _WpPipewireSimpleEndpoint
|
|||
/* The remote pipewire */
|
||||
WpRemotePipewire *remote_pipewire;
|
||||
|
||||
/* Handler */
|
||||
gulong proxy_node_done_handler_id;
|
||||
|
||||
/* Proxies */
|
||||
WpProxyNode *proxy_node;
|
||||
struct spa_hook node_proxy_listener;
|
||||
|
|
@ -145,9 +148,11 @@ on_proxy_port_created(GObject *initable, GAsyncResult *res, gpointer data)
|
|||
g_ptr_array_add(self->proxies_port, proxy_port);
|
||||
|
||||
/* Register the done callback */
|
||||
g_signal_connect(self->proxy_node, "done", (GCallback)on_all_ports_done,
|
||||
self);
|
||||
wp_proxy_sync (WP_PROXY(self->proxy_node));
|
||||
if (!self->proxy_node_done_handler_id) {
|
||||
self->proxy_node_done_handler_id = g_signal_connect_object(self->proxy_node,
|
||||
"done", (GCallback)on_all_ports_done, self, 0);
|
||||
wp_proxy_sync (WP_PROXY(self->proxy_node));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -267,8 +272,8 @@ wp_simple_endpoint_init_async (GAsyncInitable *initable, int io_priority,
|
|||
/* Register a port_added callback */
|
||||
self->remote_pipewire = wp_core_get_global (core, WP_GLOBAL_REMOTE_PIPEWIRE);
|
||||
g_return_if_fail(self->remote_pipewire);
|
||||
g_signal_connect(self->remote_pipewire, "global-added::port",
|
||||
(GCallback)on_port_added, self);
|
||||
g_signal_connect_object(self->remote_pipewire, "global-added::port",
|
||||
(GCallback)on_port_added, self, 0);
|
||||
|
||||
/* Create the proxy node async */
|
||||
node_proxy = wp_remote_pipewire_proxy_bind (self->remote_pipewire,
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ struct _WpPwAudioSoftdspEndpoint
|
|||
/* The remote pipewire */
|
||||
WpRemotePipewire *remote_pipewire;
|
||||
|
||||
/* Handler */
|
||||
gulong proxy_dsp_done_handler_id;
|
||||
|
||||
/* temporary method to select which endpoint
|
||||
* is going to be the default input/output */
|
||||
gboolean selected;
|
||||
|
|
@ -438,8 +441,11 @@ on_proxy_dsp_port_created(GObject *initable, GAsyncResult *res, gpointer data)
|
|||
g_ptr_array_add(self->proxies_dsp_port, proxy_dsp_port);
|
||||
|
||||
/* Register a callback to know when all the dsp ports have been emitted */
|
||||
g_signal_connect(self->proxy_dsp, "done", (GCallback)on_proxy_dsp_done, self);
|
||||
wp_proxy_sync (WP_PROXY(self->proxy_dsp));
|
||||
if (!self->proxy_dsp_done_handler_id) {
|
||||
self->proxy_dsp_done_handler_id = g_signal_connect_object(self->proxy_dsp,
|
||||
"done", (GCallback)on_proxy_dsp_done, self, 0);
|
||||
wp_proxy_sync (WP_PROXY(self->proxy_dsp));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -641,8 +647,8 @@ wp_endpoint_init_async (GAsyncInitable *initable, int io_priority,
|
|||
/* Register a port_added callback */
|
||||
self->remote_pipewire = wp_core_get_global (core, WP_GLOBAL_REMOTE_PIPEWIRE);
|
||||
g_return_if_fail(self->remote_pipewire);
|
||||
g_signal_connect(self->remote_pipewire, "global-added::port",
|
||||
(GCallback)on_port_added, self);
|
||||
g_signal_connect_object(self->remote_pipewire, "global-added::port",
|
||||
(GCallback)on_port_added, self, 0);
|
||||
|
||||
/* Call the parent interface */
|
||||
wp_endpoint_parent_interface->init_async (initable, io_priority, cancellable,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue