From 2ad102d3d7c5caf82f9386e75b966dd9d4b4628a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 9 Jan 2014 01:57:00 -0800 Subject: [PATCH] shared: Remove watches before freeing IO channel --- src/shared/io-glib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/shared/io-glib.c b/src/shared/io-glib.c index a7ac95f56..010dc7178 100644 --- a/src/shared/io-glib.c +++ b/src/shared/io-glib.c @@ -77,6 +77,12 @@ void io_destroy(struct io *io) if (!io) return; + if (io->read_watch > 0) + g_source_remove(io->read_watch); + + if (io->write_watch > 0) + g_source_remove(io->write_watch); + g_io_channel_unref(io->channel); g_free(io); -- 2.47.3