From 0eca0efbf6e7481995155107bdeb7277efcd4c0c Mon Sep 17 00:00:00 2001 From: Zhenhua Zhang Date: Wed, 23 Sep 2009 18:57:17 +0800 Subject: Unref GIOChannel in g_at_chat_new_from_tty --- gatchat/gatchat.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c index 5b3a2146..8407338b 100644 --- a/gatchat/gatchat.c +++ b/gatchat/gatchat.c @@ -984,6 +984,7 @@ GAtChat *g_at_chat_new_from_tty(const char *device, GAtSyntax *syntax) { GIOChannel *channel; int fd; + GAtChat *chat; fd = open_device(device); if (fd < 0) @@ -995,7 +996,9 @@ GAtChat *g_at_chat_new_from_tty(const char *device, GAtSyntax *syntax) return NULL; } - return g_at_chat_new(channel, syntax); + chat = g_at_chat_new(channel, syntax); + g_io_channel_unref(channel); + return chat; } GAtChat *g_at_chat_ref(GAtChat *chat) -- cgit v1.2.3