component = socket_source->component;
+ if (g_source_is_destroyed (g_main_current_source ())) {
+ /* Silently return FALSE. */
+ nice_debug ("%s: source %p destroyed", G_STRFUNC, g_main_current_source ());
+ return G_SOURCE_REMOVE;
+ }
+
agent = g_weak_ref_get (&component->agent_ref);
if (agent == NULL)
return G_SOURCE_REMOVE;
agent_lock (agent);
- stream = agent_find_stream (agent, component->stream_id);
-
- if (stream == NULL) {
- nice_debug ("%s: stream %d destroyed", G_STRFUNC, component->stream_id);
+ if (g_source_is_destroyed (g_main_current_source ())) {
+ /* Silently return FALSE. */
+ nice_debug ("%s: source %p destroyed", G_STRFUNC, g_main_current_source ());
agent_unlock (agent);
g_object_unref (agent);
return G_SOURCE_REMOVE;
}
- if (g_source_is_destroyed (g_main_current_source ())) {
- /* Silently return FALSE. */
- nice_debug ("%s: source %p destroyed", G_STRFUNC, g_main_current_source ());
+ stream = agent_find_stream (agent, component->stream_id);
+
+ if (stream == NULL) {
+ nice_debug ("%s: stream %d destroyed", G_STRFUNC, component->stream_id);
agent_unlock (agent);
g_object_unref (agent);
cmp = NICE_COMPONENT (obj);
/* Component should have been closed already. */
+ g_warn_if_fail (cmp->socket_sources == NULL);
g_warn_if_fail (cmp->local_candidates == NULL);
g_warn_if_fail (cmp->remote_candidates == NULL);
g_warn_if_fail (g_queue_get_length (&cmp->incoming_checks) == 0);