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);
}
}