@@ -191,7 +191,7 @@ static void proxy_removed(GDBusProxy *proxy, void *user_data)
admin_policy_status_removed(proxy);
}
-static GDBusClient *client;
+static GDBusClient *client = NULL;
static void disconnect_handler(DBusConnection *connection, void *user_data)
{
@@ -215,6 +215,5 @@ void admin_add_submenu(void)
void admin_remove_submenu(void)
{
- g_dbus_client_unref(client);
- client = NULL;
+ g_clear_pointer(&client, g_dbus_client_unref);
}
@@ -390,7 +390,7 @@ static const struct bt_shell_menu assistant_menu = {
{} },
};
-static GDBusClient * client;
+static GDBusClient * client = NULL;
void assistant_add_submenu(void)
{
@@ -409,7 +409,6 @@ void assistant_add_submenu(void)
void assistant_remove_submenu(void)
{
- g_dbus_client_unref(client);
- client = NULL;
+ g_clear_pointer(&client, g_dbus_client_unref);
}
@@ -5694,7 +5694,7 @@ static const struct bt_shell_menu transport_menu = {
{} },
};
-static GDBusClient *client;
+static GDBusClient *client = NULL;
void player_add_submenu(void)
{
@@ -5715,6 +5715,6 @@ void player_add_submenu(void)
void player_remove_submenu(void)
{
- g_dbus_client_unref(client);
+ g_clear_pointer(&client, g_dbus_client_unref);
queue_destroy(ios, transport_free);
}