pa_assert_se(o = i->userdata);
pa_module_unload_request(o->userdata->module, TRUE);
+ pa_idxset_remove_by_data(o->userdata->outputs, o, NULL);
output_free(o);
}
if (!u->automatic)
u->unlinked_slaves = pa_strlist_prepend(u->unlinked_slaves, s->name);
+ pa_idxset_remove_by_data(u->outputs, o, NULL);
output_free(o);
return PA_HOOK_OK;
void pa__done(pa_module*m) {
struct userdata *u;
- struct output *o;
pa_assert(m);
if (u->sink_state_changed_slot)
pa_hook_slot_free(u->sink_state_changed_slot);
- if (u->outputs) {
- while ((o = pa_idxset_first(u->outputs, NULL)))
- output_free(o);
-
- pa_idxset_free(u->outputs, NULL, NULL);
- }
+ if (u->outputs)
+ pa_idxset_free(u->outputs, (pa_free_cb_t) output_free);
if (u->sink)
pa_sink_unlink(u->sink);