From c8aa6459736a23c1ce2db74652aecc4577053746 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 13 Apr 2010 15:56:29 -0500 Subject: [PATCH] ppp: Refing the channel is actually not necessary The read_watch and write_watches both take a ref --- gatchat/gatppp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c index b917ba1..e1e49e6 100644 --- a/gatchat/gatppp.c +++ b/gatchat/gatppp.c @@ -566,9 +566,7 @@ GAtPPP *g_at_ppp_new(GIOChannel *modem) if (!ppp) return NULL; - ppp->modem = g_io_channel_ref(modem); - if (!g_at_util_setup_io(ppp->modem, G_IO_FLAG_NONBLOCK)) { - g_io_channel_unref(modem); + if (!g_at_util_setup_io(modem, G_IO_FLAG_NONBLOCK)) { g_free(ppp); return NULL; } @@ -599,6 +597,7 @@ GAtPPP *g_at_ppp_new(GIOChannel *modem) ppp_read_cb, ppp, (GDestroyNotify)read_watcher_destroy_notify); + ppp->modem = modem; ppp->record_fd = -1; return ppp; -- 2.7.4