mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-10 13:33:33 +08:00
Fix signal emissions when removing adapters
This commit is contained in:
parent
82e9ab56be
commit
c004bc8c66
@ -351,12 +351,9 @@ static void manager_remove_adapter(struct btd_adapter *adapter)
|
||||
uint16_t dev_id = adapter_get_dev_id(adapter);
|
||||
const gchar *path = adapter_get_path(adapter);
|
||||
|
||||
manager_update_adapters();
|
||||
adapters = g_slist_remove(adapters, adapter);
|
||||
|
||||
g_dbus_emit_signal(connection, "/",
|
||||
MANAGER_INTERFACE, "AdapterRemoved",
|
||||
DBUS_TYPE_OBJECT_PATH, &path,
|
||||
DBUS_TYPE_INVALID);
|
||||
manager_update_adapters();
|
||||
|
||||
if (default_adapter_id == dev_id || default_adapter_id < 0) {
|
||||
int new_default = hci_get_route(NULL);
|
||||
@ -364,7 +361,11 @@ static void manager_remove_adapter(struct btd_adapter *adapter)
|
||||
manager_set_default_adapter(new_default);
|
||||
}
|
||||
|
||||
adapters = g_slist_remove(adapters, adapter);
|
||||
g_dbus_emit_signal(connection, "/",
|
||||
MANAGER_INTERFACE, "AdapterRemoved",
|
||||
DBUS_TYPE_OBJECT_PATH, &path,
|
||||
DBUS_TYPE_INVALID);
|
||||
|
||||
adapter_remove(adapter);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user