mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
hashmap: Add pa_hashmap_remove_all()
Slightly nicer than using pa_hashmap_steal_first() in a loop.
This commit is contained in:
parent
061878b5a4
commit
31ee1a7d54
7 changed files with 23 additions and 22 deletions
|
|
@ -3740,7 +3740,7 @@ static void mapping_paths_probe(pa_alsa_mapping *m, pa_alsa_profile *profile,
|
|||
mixer_handle = pa_alsa_open_mixer_for_pcm(pcm_handle, NULL, &hctl_handle);
|
||||
if (!mixer_handle || !hctl_handle) {
|
||||
/* Cannot open mixer, remove all entries */
|
||||
while (pa_hashmap_steal_first(ps->paths));
|
||||
pa_hashmap_remove_all(ps->paths, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -141,8 +141,7 @@ static int get_session_list(struct userdata *u) {
|
|||
free(sessions);
|
||||
}
|
||||
|
||||
while ((o = pa_hashmap_steal_first(u->previous_sessions)))
|
||||
free_session(o);
|
||||
pa_hashmap_remove_all(u->previous_sessions, (pa_free_cb_t) free_session);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue