summaryrefslogtreecommitdiffstats
path: root/gatchat/gatppp.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-04-13 15:56:29 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-04-13 15:57:07 -0500
commitc8aa6459736a23c1ce2db74652aecc4577053746 (patch)
treeab86621751ff30492365b6ce9ccf5f2543defbcb /gatchat/gatppp.c
parent8e15816ac1fccd0be4a1da2a6551870b769e0367 (diff)
downloadofono-c8aa6459736a23c1ce2db74652aecc4577053746.tar.bz2
ppp: Refing the channel is actually not necessary
The read_watch and write_watches both take a ref
Diffstat (limited to 'gatchat/gatppp.c')
-rw-r--r--gatchat/gatppp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index b917ba15..e1e49e6c 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;