gatchat: remove write watcher on a disconnect

There's a small probability that we call chat_wakeup_writer
just before the channel disonnects.  When this happens the write
watcher still fires causing a potential crash.
This commit is contained in:
Denis Kenzior 2010-11-23 03:21:22 -06:00
parent 5774e9fa53
commit 99107c6c9d
1 changed files with 3 additions and 0 deletions

View File

@ -315,6 +315,9 @@ static gboolean io_shutdown(GAtIO *io)
if (io->read_watch > 0)
g_source_remove(io->read_watch);
if (io->write_watch > 0)
g_source_remove(io->write_watch);
return TRUE;
}