Fix signal emissions when removing adapters

This commit is contained in:
Marcel Holtmann 2008-12-23 09:36:42 +01:00
parent 82e9ab56be
commit c004bc8c66

View File

@ -351,12 +351,9 @@ static void manager_remove_adapter(struct btd_adapter *adapter)
uint16_t dev_id = adapter_get_dev_id(adapter); uint16_t dev_id = adapter_get_dev_id(adapter);
const gchar *path = adapter_get_path(adapter); const gchar *path = adapter_get_path(adapter);
manager_update_adapters(); adapters = g_slist_remove(adapters, adapter);
g_dbus_emit_signal(connection, "/", manager_update_adapters();
MANAGER_INTERFACE, "AdapterRemoved",
DBUS_TYPE_OBJECT_PATH, &path,
DBUS_TYPE_INVALID);
if (default_adapter_id == dev_id || default_adapter_id < 0) { if (default_adapter_id == dev_id || default_adapter_id < 0) {
int new_default = hci_get_route(NULL); 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); 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); adapter_remove(adapter);
} }