gatio: Remove g_at_io_shutdown

This commit is contained in:
Denis Kenzior 2010-04-27 16:26:54 -05:00
parent 204814da05
commit 43c30e2292
2 changed files with 13 additions and 18 deletions

View File

@ -208,6 +208,18 @@ GAtIO *g_at_io_ref(GAtIO *io)
return io;
}
static gboolean io_shutdown(GAtIO *io)
{
/* Don't trigger user disconnect on shutdown */
io->user_disconnect = NULL;
io->user_disconnect_data = NULL;
if (io->read_watch > 0)
g_source_remove(io->read_watch);
return TRUE;
}
void g_at_io_unref(GAtIO *io)
{
gboolean is_zero;
@ -220,7 +232,7 @@ void g_at_io_unref(GAtIO *io)
if (is_zero == FALSE)
return;
g_at_io_shutdown(io);
io_shutdown(io);
/* glib delays the destruction of the watcher until it exits, this
* means we can't free the data just yet, even though we've been
@ -233,21 +245,6 @@ void g_at_io_unref(GAtIO *io)
g_free(io);
}
gboolean g_at_io_shutdown(GAtIO *io)
{
if (io->channel == NULL)
return FALSE;
/* Don't trigger user disconnect on shutdown */
io->user_disconnect = NULL;
io->user_disconnect_data = NULL;
if (io->read_watch > 0)
g_source_remove(io->read_watch);
return TRUE;
}
gboolean g_at_io_set_disconnect_function(GAtIO *io,
GAtDisconnectFunc disconnect, gpointer user_data)
{

View File

@ -43,8 +43,6 @@ GIOChannel *g_at_io_get_channel(GAtIO *io);
GAtIO *g_at_io_ref(GAtIO *io);
void g_at_io_unref(GAtIO *io);
gboolean g_at_io_shutdown(GAtIO *io);
gboolean g_at_io_set_read_handler(GAtIO *io, GAtIOReadFunc read_handler,
gpointer user_data);