diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2014-11-24 23:35:37 +0100 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-11-26 10:07:20 +0200 |
commit | 090c21bca8c818ab6b83a2776d5d0b4a9c7ef9fb (patch) | |
tree | b577057b04090746e53f8a38286ca57cc8f308ce /src | |
parent | 23d0a252dd64b7ddf61892f53f1dcdc3dc2c80b0 (diff) | |
download | bluez-090c21bca8c818ab6b83a2776d5d0b4a9c7ef9fb.tar.gz |
shared/io-glib: Fix not calling destroy callback
Destroy callback should be called also for G_IO_ERR | G_IO_NVAL
condition.
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/io-glib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/shared/io-glib.c b/src/shared/io-glib.c index af2ba4ef7..e9578e17d 100644 --- a/src/shared/io-glib.c +++ b/src/shared/io-glib.c @@ -159,9 +159,11 @@ static gboolean watch_callback(GIOChannel *channel, GIOCondition cond, gpointer user_data) { struct io_watch *watch = user_data; - bool result; + bool result, destroy; - if (cond & (G_IO_ERR | G_IO_NVAL)) + destroy = watch == watch->io->disconnect_watch; + + if (!destroy && (cond & (G_IO_ERR | G_IO_NVAL))) return FALSE; if (watch->callback) |