From c4b6403361aa9c67dd9c5b5b4fcf972d4e40f7ab Mon Sep 17 00:00:00 2001 From: Wootak Jung Date: Tue, 12 May 2020 11:00:46 +0900 Subject: [PATCH] Fix RegisterApplication fail issue Need to set server_started flag to false if all of services are removed Change-Id: I1947f2c08882c15e20731c5d318c6689ae62d077 Signed-off-by: Wootak Jung --- src/bluetooth-gatt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bluetooth-gatt.c b/src/bluetooth-gatt.c index aab2dc2..33a7464 100644 --- a/src/bluetooth-gatt.c +++ b/src/bluetooth-gatt.c @@ -3068,6 +3068,11 @@ int bt_gatt_server_unregister_service(bt_gatt_server_h server, bt_gatt_service_destroy(svc); + if (g_slist_length(serv->services) == 0) { + BT_DBG("All of services are removed"); + is_gatt_server_started = false; + } + return BT_ERROR_NONE; } /* LCOV_EXCL_STOP */ -- 2.7.4