mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29: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
|
|
@ -1736,12 +1736,12 @@ void pa_bluetooth_discovery_unref(pa_bluetooth_discovery *y) {
|
|||
|
||||
if (y->devices) {
|
||||
remove_all_devices(y);
|
||||
pa_hashmap_free(y->devices, NULL, NULL);
|
||||
pa_hashmap_free(y->devices, NULL);
|
||||
}
|
||||
|
||||
if (y->transports) {
|
||||
pa_assert(pa_hashmap_isempty(y->transports));
|
||||
pa_hashmap_free(y->transports, NULL, NULL);
|
||||
pa_hashmap_free(y->transports, NULL);
|
||||
}
|
||||
|
||||
if (y->connection) {
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ void pa__done(pa_module* m) {
|
|||
pa_xfree(mi);
|
||||
}
|
||||
|
||||
pa_hashmap_free(u->hashmap, NULL, NULL);
|
||||
pa_hashmap_free(u->hashmap, NULL);
|
||||
}
|
||||
|
||||
if (u->modargs)
|
||||
|
|
|
|||
|
|
@ -466,14 +466,8 @@ void pa__done(pa_module*m) {
|
|||
if (!(u = m->userdata))
|
||||
return;
|
||||
|
||||
if (u->bondings) {
|
||||
struct bonding *b;
|
||||
|
||||
while ((b = pa_hashmap_steal_first(u->bondings)))
|
||||
bonding_free(b);
|
||||
|
||||
pa_hashmap_free(u->bondings, NULL, NULL);
|
||||
}
|
||||
if (u->bondings)
|
||||
pa_hashmap_free(u->bondings, (pa_free_cb_t) bonding_free);
|
||||
|
||||
if (u->dbus_connection) {
|
||||
update_matches(u, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue