diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2006-08-26 16:55:47 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2006-08-26 16:55:47 +0000 |
commit | ea7b976177bffc7f3c89e380a1273e1d85b2a24f (patch) | |
tree | 146321302301da35c12ae5ac10fd6f6700c13945 /hcid/sdp.c | |
parent | 448146fdeb6a90cdf11826fcdc88ce9068eb9646 (diff) |
Cleanup/fix glib-ectomy.c and its usage
Diffstat (limited to 'hcid/sdp.c')
-rw-r--r-- | hcid/sdp.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -64,8 +64,10 @@ static gboolean session_event(GIOChannel *chan, GIOCondition cond, gpointer data GIOError err; int sk, ret; - if (cond & (G_IO_HUP | G_IO_ERR)) + if (cond & (G_IO_HUP | G_IO_ERR)) { + g_io_channel_unref(chan); return FALSE; + } debug("Incoming SDP transaction"); @@ -131,8 +133,9 @@ static gboolean connect_event(GIOChannel *chan, GIOCondition cond, gpointer data session_data->imtu = opts.imtu; io = g_io_channel_unix_new(nsk); + g_io_channel_set_close_on_unref(io, TRUE); - g_io_add_watch_full(io, 0, G_IO_IN, session_event, + g_io_add_watch_full(io, 0, G_IO_IN | G_IO_HUP | G_IO_ERR, session_event, session_data, session_destory); return TRUE; @@ -167,6 +170,7 @@ int start_sdp_server(void) listen(sk, 5); io = g_io_channel_unix_new(sk); + g_io_channel_set_close_on_unref(io, TRUE); g_io_add_watch(io, G_IO_IN, connect_event, NULL); |