From: Johan Hedberg Date: Sun, 6 Oct 2013 15:38:17 +0000 (+0300) Subject: tools/l2cap-tester: Fix closing server sockets in time X-Git-Tag: android-x86-4.4-r3~7496 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6d98c73b9cd5d9773acdfaa797fc76fe87ef3332;p=android-x86%2Fexternal-bluetooth-bluez.git tools/l2cap-tester: Fix closing server sockets in time We should use the teardown function instead of the destroy function for closing server sockets since otherwise tests may conflict with each other. --- diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c index 802c0e4b4..df8f1bf4b 100644 --- a/tools/l2cap-tester.c +++ b/tools/l2cap-tester.c @@ -198,6 +198,11 @@ static void test_post_teardown(const void *test_data) { struct test_data *data = tester_get_data(); + if (data->io_id > 0) { + g_source_remove(data->io_id); + data->io_id = 0; + } + hciemu_unref(data->hciemu); data->hciemu = NULL; } @@ -206,9 +211,6 @@ static void test_data_free(void *test_data) { struct test_data *data = test_data; - if (data->io_id > 0) - g_source_remove(data->io_id); - free(data); }