summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2010-12-24 04:30:43 (GMT)
committerYouness Alaoui <youness.alaoui@collabora.co.uk>2010-12-24 04:30:43 (GMT)
commit796fd849f2c63c503a80361a282e57f26aa7a52a (patch)
tree4371c2cd46d6880443d8eb02b3d88d7ac7d18618
parentb025bb618dc5cbf3a997c6a15711c38b4b385e82 (diff)
downloadlibnice-796fd849f2c63c503a80361a282e57f26aa7a52a.tar.gz
libnice-796fd849f2c63c503a80361a282e57f26aa7a52a.tar.xz
only remove sources that are valid
-rw-r--r--socket/turn.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/socket/turn.c b/socket/turn.c
index ce1ec0d..b0c790c 100644
--- a/socket/turn.c
+++ b/socket/turn.c
@@ -245,7 +245,8 @@ socket_close (NiceSocket *sock)
for (i = priv->channels; i; i = i->next) {
ChannelBinding *b = i->data;
- g_source_remove (b->timeout_source);
+ if (b->timeout_source)
+ g_source_remove (b->timeout_source);
g_free (b);
}
g_list_free (priv->channels);
@@ -284,7 +285,9 @@ socket_close (NiceSocket *sock)
g_list_foreach (priv->sent_permissions, (GFunc) nice_address_free, NULL);
g_list_free (priv->sent_permissions);
g_hash_table_destroy (priv->send_data_queues);
- g_source_remove (priv->permission_timeout_source);
+
+ if (priv->permission_timeout_source)
+ g_source_remove (priv->permission_timeout_source);
g_free (priv->current_binding);
g_free (priv->current_binding_msg);