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 c9bd8bc..970476a 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; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html