From 17613ab268f5ca8670a40380ec2e42dc332396ee Mon Sep 17 00:00:00 2001 From: Philippe De Swert Date: Tue, 17 May 2011 16:15:59 +0300 Subject: [PATCH] actually remove disconnect timeout before the connected check otherwise we will never reach it unless we effectively disconnect Signed-off-by: Philippe De Swert --- src/usb_moded.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/usb_moded.c b/src/usb_moded.c index e1e1477..74da9fb 100644 --- a/src/usb_moded.c +++ b/src/usb_moded.c @@ -94,6 +94,11 @@ void set_usb_connected(gboolean connected) if(connected) { + if(debounce) + { + g_source_remove(debounce); + debounce = 0; + } /* do not go through the routine if already connected to avoid spurious load/unloads due to faulty signalling NOKIA: careful with devicelock @@ -101,11 +106,6 @@ void set_usb_connected(gboolean connected) if(current_mode.connected) return; - if(debounce) - { - g_source_remove(debounce); - debounce = 0; - } #ifdef NOKIA if(timeout_source) {