void audio_device_unregister(struct audio_device *device) { unix_device_removed(device); if (device->hs_preauth_id) { g_source_remove(device->hs_preauth_id); device->hs_preauth_id = 0; } if (device->headset) headset_unregister(device); if (device->gateway) gateway_unregister(device); if (device->sink) sink_unregister(device); if (device->source) source_unregister(device); if (device->control) control_unregister(device); g_dbus_unregister_interface(device->conn, device->path, AUDIO_INTERFACE); device_free(device); }
static void control_destroy(struct sml_control *control) { assert(tlv_get(current_control) == control); #ifndef WITHOUT_MULTITHREAD /* To release the thread local heap exclusively, it must be * occupied by the current thread. */ assert(IS_ACTIVE(load_relaxed(&control->state))); #endif /* !WITHOUT_MULTITHREAD */ if (control->thread_local_heap) { sml_heap_mutator_destroy(control->thread_local_heap); control->thread_local_heap = NULL; } /* Pointers in the stack is safely ignored since the thread has * been terminated. */ control->frame_stack = NULL; control_leave(control); control_unregister(control); tlv_set(current_control, NULL); mutex_destroy(&control->inactive_wait_lock); cond_destroy(&control->inactive_wait_cond); free(control); }
void audio_device_unregister(struct audio_device *device) { DBG("%s", device_get_path(device->btd_dev)); if (device->sink) sink_unregister(device); if (device->source) source_unregister(device); if (device->control) control_unregister(device); device_free(device); }
static void avrcp_remote_remove(struct btd_service *service) { control_unregister(service); }