Skip to content

Commit

Permalink
modules/bluez: check if devices hash table exists before calling remo…
Browse files Browse the repository at this point in the history
…ve_all
  • Loading branch information
LBCrion committed Aug 4, 2024
1 parent e2c5b19 commit a731dbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/bluez.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,8 @@ static void bz_name_disappeared_cb (GDBusConnection *con, const gchar *name,
{
while(adapters)
bz_adapter_free(adapters->data);
g_hash_table_remove_all(devices);
if(devices)
g_hash_table_remove_all(devices);
g_dbus_connection_signal_unsubscribe(bz_con, sub_add);
g_dbus_connection_signal_unsubscribe(bz_con, sub_del);
g_dbus_connection_signal_unsubscribe(bz_con, sub_chg);
Expand Down

0 comments on commit a731dbb

Please sign in to comment.