summaryrefslogtreecommitdiffstats
path: root/test/hciemu.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-08-26 17:26:18 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-08-26 17:26:18 +0000
commit2f1fece0402ce32292bc17dae43e3becbd19683f (patch)
tree704b0ee862894c79799e4d6409c50f85beb1d704 /test/hciemu.c
parentea7b976177bffc7f3c89e380a1273e1d85b2a24f (diff)
Fix hciemu GIOChannel usage
Diffstat (limited to 'test/hciemu.c')
-rw-r--r--test/hciemu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/hciemu.c b/test/hciemu.c
index 37e80318..2631868d 100644
--- a/test/hciemu.c
+++ b/test/hciemu.c
@@ -503,6 +503,7 @@ static void close_connection(struct vhci_conn *conn)
batostr(&conn->dest), conn->handle);
g_io_channel_close(conn->chan);
+ g_io_channel_unref(conn->chan);
vconn[conn->handle - 1] = NULL;
disconn_complete(conn);
@@ -875,8 +876,10 @@ static gboolean io_acl_data(GIOChannel *chan, GIOCondition cond, gpointer data)
uint16_t flags;
int fd, err, len;
- if (cond & G_IO_NVAL)
+ if (cond & G_IO_NVAL) {
+ g_io_channel_unref(chan);
return FALSE;
+ }
if (cond & G_IO_HUP) {
close_connection(conn);
@@ -975,6 +978,7 @@ static gboolean io_hci_data(GIOChannel *chan, GIOCondition cond, gpointer data)
return TRUE;
syslog(LOG_ERR, "Read failed: %s (%d)", strerror(errno), errno);
+ g_io_channel_unref(chan);
g_main_quit(event_loop);
return FALSE;
}