OSDN Git Service

android: Fix not clearing up start timeout watch
authorSzymon Janc <szymon.janc@gmail.com>
Tue, 23 Sep 2014 19:26:51 +0000 (21:26 +0200)
committerSzymon Janc <szymon.janc@gmail.com>
Tue, 23 Sep 2014 20:13:50 +0000 (22:13 +0200)
If start failed due to no adapter being ready before timeout fired
invalid watch was removed on shutdown resulting in:

(bluetoothd:17083): GLib-CRITICAL **: Source ID 2 was not found
when attempting to remove it

android/main.c

index e99b451..1250562 100644 (file)
@@ -357,6 +357,9 @@ static void bluetooth_stopped(void)
 static gboolean quit_eventloop(gpointer user_data)
 {
        g_main_loop_quit(event_loop);
+
+       bluetooth_start_timeout = 0;
+
        return FALSE;
 }