From b809cae2368e5ad0bed46e9be7afef99fed80786 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 23 Aug 2012 18:40:00 +0300 Subject: [PATCH] network: Fix warning when removing connection timeout handler The source should only be removed once as it can cause the following warning: GLib-CRITICAL **: g_source_remove: assertion `tag > 0' failed --- profiles/network/connection.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/profiles/network/connection.c b/profiles/network/connection.c index 59423a900..e8ac64362 100644 --- a/profiles/network/connection.c +++ b/profiles/network/connection.c @@ -207,8 +207,10 @@ static gboolean bnep_setup_cb(GIOChannel *chan, GIOCondition cond, if (cond & G_IO_NVAL) return FALSE; - g_source_remove(nc->timeout_source); - nc->timeout_source = 0; + if (nc->timeout_source > 0) { + g_source_remove(nc->timeout_source); + nc->timeout_source = 0; + } if (cond & (G_IO_HUP | G_IO_ERR)) { error("Hangup or error on l2cap server socket"); -- 2.47.3