From 2f1fece0402ce32292bc17dae43e3becbd19683f Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sat, 26 Aug 2006 17:26:18 +0000 Subject: Fix hciemu GIOChannel usage --- test/hciemu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/hciemu.c') 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; } -- cgit