summaryrefslogtreecommitdiffstats
path: root/gatchat/gatio.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-11-23 03:21:22 -0600
committerDenis Kenzior <denkenz@gmail.com>2010-11-23 03:21:22 -0600
commit99107c6c9d0ae42eb96621b0fc34972e418f1755 (patch)
tree5167a9864f8789bcc02c7662acd95e4f99d6fd82 /gatchat/gatio.c
parent5774e9fa5357ca0ea3661668b44f1bc23ba83b89 (diff)
downloadofono-99107c6c9d0ae42eb96621b0fc34972e418f1755.tar.bz2
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.
Diffstat (limited to 'gatchat/gatio.c')
-rw-r--r--gatchat/gatio.c3
1 files changed, 3 insertions, 0 deletions
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;
}