From 99107c6c9d0ae42eb96621b0fc34972e418f1755 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 23 Nov 2010 03:21:22 -0600 Subject: 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. --- gatchat/gatio.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gatchat/gatio.c') diff --git a/gatchat/gatio.c b/gatchat/gatio.c index 61b0260a..a9faba50 100644 --- a/gatchat/gatio.c +++ b/gatchat/gatio.c @@ -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; } -- cgit v1.2.3