summaryrefslogtreecommitdiff
path: root/socket/tcp-bsd.c
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2012-02-08 22:46:07 -0500
committerYouness Alaoui <youness.alaoui@collabora.co.uk>2012-02-08 22:47:18 -0500
commit6449dabb959c8e713c76ecf0c5eac4609c311ca2 (patch)
treed9bb67d5cd8c246427ce3b63dc640fc02c0fd86a /socket/tcp-bsd.c
parent85229f996215000a3dc690700cdf015a4c0a7e77 (diff)
parent50e8cf8468f5455c57e175ff54ad90ff14474832 (diff)
downloadlibnice-6449dabb959c8e713c76ecf0c5eac4609c311ca2.tar.gz
Merge branch 'master' of ssh://dhansak/srv/git.collabora.co.uk/git/libnice
Conflicts: configure.ac
Diffstat (limited to 'socket/tcp-bsd.c')
-rw-r--r--socket/tcp-bsd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/socket/tcp-bsd.c b/socket/tcp-bsd.c
index 255a234..ac90eaa 100644
--- a/socket/tcp-bsd.c
+++ b/socket/tcp-bsd.c
@@ -54,7 +54,6 @@
#endif
typedef struct {
- NiceAgent *agent;
NiceAddress server_addr;
GQueue send_queue;
GMainContext *context;
@@ -86,7 +85,7 @@ static gboolean socket_send_more (GIOChannel *source, GIOCondition condition,
gpointer data);
NiceSocket *
-nice_tcp_bsd_socket_new (NiceAgent *agent, GMainContext *ctx, NiceAddress *addr)
+nice_tcp_bsd_socket_new (GMainContext *ctx, NiceAddress *addr)
{
int sockfd = -1;
int ret;
@@ -163,8 +162,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 +195,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);
}