diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2011-09-20 23:08:21 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2011-09-20 23:52:05 -0400 |
commit | 5aa81a864c8b50c81e4cc8eff9708f0dacb7ce31 (patch) | |
tree | 52972d12ca6c785d3d401964a006eee0ebf94fda /socket/tcp-bsd.c | |
parent | a41f0d63afbcdb3455a1636f393b2eaef53c6e8f (diff) | |
download | libnice-5aa81a864c8b50c81e4cc8eff9708f0dacb7ce31.tar.gz |
Keep a ref on the GMainContext that are attached to
Diffstat (limited to 'socket/tcp-bsd.c')
-rw-r--r-- | socket/tcp-bsd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/socket/tcp-bsd.c b/socket/tcp-bsd.c index c8a5c48..67aeb5e 100644 --- a/socket/tcp-bsd.c +++ b/socket/tcp-bsd.c @@ -164,7 +164,7 @@ nice_tcp_bsd_socket_new (NiceAgent *agent, GMainContext *ctx, NiceAddress *addr) sock->priv = priv = g_slice_new0 (TcpPriv); priv->agent = agent; - priv->context = ctx; + priv->context = g_main_context_ref (ctx); priv->server_addr = *addr; priv->error = FALSE; @@ -197,6 +197,9 @@ socket_close (NiceSocket *sock) g_queue_foreach (&priv->send_queue, (GFunc) free_to_be_sent, NULL); g_queue_clear (&priv->send_queue); + if (priv->context) + g_main_context_unref (priv->context); + g_slice_free(TcpPriv, sock->priv); } |