Commit a42bf857 authored by Olivier Crête's avatar Olivier Crête

component: Free GSocket sources when parent source is dead

parent acb95943
......@@ -1128,16 +1128,34 @@ component_source_prepare (GSource *source, gint *timeout_)
component_source->current_condition = 0;
agent = g_weak_ref_get (&component_source->agent_ref);
if (!agent)
return FALSE;
if (!agent) {
while ((childl = component_source->socket_sources) != NULL) {
ChildSocketSource *child_socket_source = childl->data;
g_source_remove_child_source (source, child_socket_source->source);
free_child_socket_source (child_socket_source);
component_source->socket_sources =
g_slist_delete_link (component_source->socket_sources, childl);
}
return FALSE;
}
/* Needed due to accessing the Component. */
agent_lock ();
if (!agent_find_component (agent,
component_source->stream_id, component_source->component_id, NULL,
&component))
&component)) {
while ((childl = component_source->socket_sources) != NULL) {
ChildSocketSource *child_socket_source = childl->data;
g_source_remove_child_source (source, child_socket_source->source);
free_child_socket_source (child_socket_source);
component_source->socket_sources =
g_slist_delete_link (component_source->socket_sources, childl);
}
goto done;
}
if (component->socket_sources_age ==
......
Markdown is supported
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