pa_assert(pcm_handle);
mixer_handle = pa_alsa_open_mixer_for_pcm(pcm_handle, NULL, &hctl_handle);
- if (!mixer_handle || !hctl_handle) {
- /* Cannot open mixer, remove all entries */
+ if (!mixer_handle) {
+ /* Cannot open mixer, remove all entries */
pa_hashmap_remove_all(ps->paths);
return;
}
p = pa_hashmap_iterate(h, &state, &key);
while (p) {
- if (pa_hashmap_get(keep, p) == NULL) {
- pa_hashmap_remove(h, key);
- pa_alsa_path_free(p);
- }
+ if (pa_hashmap_get(keep, p) == NULL)
+ pa_hashmap_remove_and_free(h, key);
p = pa_hashmap_iterate(h, &state, &key);
}
}
void *state;
PA_HASHMAP_FOREACH(p, ps->profiles, state) {
- if (!p->supported) {
- pa_hashmap_remove(ps->profiles, p->name);
- profile_free(p);
- }
+ if (!p->supported)
+ pa_hashmap_remove_and_free(ps->profiles, p->name);
}
PA_HASHMAP_FOREACH(m, ps->mappings, state) {
- if (m->supported <= 0) {
- pa_hashmap_remove(ps->mappings, m->name);
- mapping_free(m);
- }
+ if (m->supported <= 0)
+ pa_hashmap_remove_and_free(ps->mappings, m->name);
}
}