mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-17 06:59:56 -05:00
hashmap: Use pa_free_cb_t instead of pa_free2_cb_t
The previous patch removed module-gconf's dependency on the userdata pointer of the free callback, and that was the only place where the userdata pointer of pa_free2_cb_t was used, so now there's no need for pa_free2_cb_t in pa_hashmap_free(). Using pa_free_cb_t instead allows removing a significant amount of repetitive code.
This commit is contained in:
parent
dcf043842e
commit
8872c238ba
41 changed files with 112 additions and 308 deletions
|
|
@ -543,14 +543,6 @@ pa_dbusiface_card *pa_dbusiface_card_new(pa_dbusiface_core *core, pa_card *card)
|
|||
return c;
|
||||
}
|
||||
|
||||
static void profile_free_cb(void *p, void *userdata) {
|
||||
pa_dbusiface_card_profile *profile = p;
|
||||
|
||||
pa_assert(profile);
|
||||
|
||||
pa_dbusiface_card_profile_free(profile);
|
||||
}
|
||||
|
||||
void pa_dbusiface_card_free(pa_dbusiface_card *c) {
|
||||
pa_assert(c);
|
||||
|
||||
|
|
@ -558,7 +550,7 @@ void pa_dbusiface_card_free(pa_dbusiface_card *c) {
|
|||
|
||||
pa_hook_slot_free(c->card_profile_added_slot);
|
||||
|
||||
pa_hashmap_free(c->profiles, profile_free_cb, NULL);
|
||||
pa_hashmap_free(c->profiles, (pa_free_cb_t) pa_dbusiface_card_profile_free);
|
||||
pa_proplist_free(c->proplist);
|
||||
pa_dbus_protocol_unref(c->dbus_protocol);
|
||||
pa_subscription_free(c->subscription);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue