From 6d98c73b9cd5d9773acdfaa797fc76fe87ef3332 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sun, 6 Oct 2013 18:38:17 +0300 Subject: [PATCH] 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. --- tools/l2cap-tester.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); } -- 2.11.0