diff --git a/dbus/gattlib.c b/dbus/gattlib.c index 282ff5d..8327eef 100644 --- a/dbus/gattlib.c +++ b/dbus/gattlib.c @@ -225,6 +225,13 @@ FREE_CONNECTION: FREE_CONN_CONTEXT: free(conn_context); + + // destroy default adapter + if(adapter == NULL) + { + gattlib_adapter_close(gattlib_adapter); + } + return NULL; }