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

config-policy: fix endpoint refcount issues

parent 8adde3df
No related branches found
No related tags found
No related merge requests found
......@@ -174,7 +174,7 @@ wp_config_policy_handle_pending_link (WpConfigPolicy *self,
/* linked to the wrong target so unlink and continue */
g_debug ("Unlinking endpoint '%s' from its previous target",
wp_base_endpoint_get_name (li->ep));
WpBaseEndpoint *ep = wp_base_endpoint_link_get_sink_endpoint (l);
g_autoptr (WpBaseEndpoint) ep = wp_base_endpoint_link_get_sink_endpoint (l);
guint32 stream_id = wp_base_endpoint_link_get_sink_stream (l);
fade_out (ep, stream_id, on_faded_destroy_link, l);
}
......@@ -186,7 +186,7 @@ wp_config_policy_handle_pending_link (WpConfigPolicy *self,
for (guint i = 0; i < links->len; i++) {
WpBaseEndpointLink *l = g_ptr_array_index (links, i);
if (!wp_base_endpoint_link_is_kept (l)) {
WpBaseEndpoint *ep = wp_base_endpoint_link_get_sink_endpoint (l);
g_autoptr (WpBaseEndpoint) ep = wp_base_endpoint_link_get_sink_endpoint (l);
guint32 stream_id = wp_base_endpoint_link_get_sink_stream (l);
fade_out (ep, stream_id, on_faded_destroy_link, l);
}
......@@ -397,7 +397,7 @@ wp_config_policy_add_link_info (WpConfigPolicy *self, GHashTable *table,
const struct WpParserEndpointLinkData *data = NULL;
const char *ep_role = wp_base_endpoint_get_role (ep);
struct link_info *res = NULL;
WpBaseEndpoint *target = NULL;
g_autoptr (WpBaseEndpoint) target = NULL;
guint32 stream_id = WP_STREAM_ID_NONE;
/* Get the parser for the endpoint-link extension */
......@@ -425,7 +425,7 @@ wp_config_policy_add_link_info (WpConfigPolicy *self, GHashTable *table,
if (!link_infos) {
link_infos = g_ptr_array_new_with_free_func (link_info_destroy);
g_ptr_array_add (link_infos, res);
g_hash_table_insert (table, g_object_ref (target), link_infos);
g_hash_table_insert (table, g_steal_pointer (&target), link_infos);
} else {
g_ptr_array_add (link_infos, res);
}
......
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