Fix RegisterApplication fail issue 86/233086/1
authorWootak Jung <wootak.jung@samsung.com>
Tue, 12 May 2020 02:00:46 +0000 (11:00 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Tue, 12 May 2020 02:00:46 +0000 (11:00 +0900)
Need to set server_started flag to false if all of services are removed

Change-Id: I1947f2c08882c15e20731c5d318c6689ae62d077
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
src/bluetooth-gatt.c

index aab2dc2..33a7464 100644 (file)
@@ -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 */