Skip to content
Snippets Groups Projects
Commit 42bdf3ee authored by Julian Bouzas's avatar Julian Bouzas
Browse files

modules: unregister the endpoints when their proxy is destroyed

parent 922065f9
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment