From 4594c36cf35c1ce6231e8b09111b3bc14d30b292 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 24 Feb 2009 17:49:24 +0200 Subject: Shutdown IO channel in the case of error --- common/btio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/btio.c b/common/btio.c index 0074d4f9..dbbc4287 100644 --- a/common/btio.c +++ b/common/btio.c @@ -148,7 +148,10 @@ static gboolean connect_cb(GIOChannel *io, GIOCondition cond, conn->connect(io, gerr, conn->user_data); - g_clear_error(&gerr); + if (gerr) { + g_io_channel_shutdown(io, FALSE, NULL); + g_error_free(gerr); + } return FALSE; } -- cgit