ppp: Refing the channel is actually not necessary

The read_watch and write_watches both take a ref
This commit is contained in:
Denis Kenzior 2010-04-13 15:56:29 -05:00
parent 8e15816ac1
commit c8aa645973
1 changed files with 2 additions and 3 deletions

View File

@ -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;