From e6eee7c2fcf974dbe56db7fae479bb224685dcb2 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Fri, 29 Aug 2014 10:33:58 +0200 Subject: [PATCH] android/avdtp: Cleanup watch id when removing session watch When session_cb returns FALSE respective watch id is removed so it must be cleanup. This fix following Glib warning when unrefing avdtp after transport was disconnected by remote: (process:28510): GLib-CRITICAL **: Source ID 2 was not found when attempting to remove it --- android/avdtp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/android/avdtp.c b/android/avdtp.c index c9bd8bccc..970476a89 100644 --- a/android/avdtp.c +++ b/android/avdtp.c @@ -1974,8 +1974,11 @@ static gboolean session_cb(GIOChannel *chan, GIOCondition cond, DBG(""); - if (cond & G_IO_NVAL) + if (cond & G_IO_NVAL) { + session->io_id = 0; + return FALSE; + } header = (void *) session->buf; @@ -2078,6 +2081,8 @@ next: failed: connection_lost(session, EIO); + session->io_id = 0; + return FALSE; } -- 2.47.3