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:
Tanu Kaskinen 2013-02-12 21:36:53 +02:00
parent dcf043842e
commit 8872c238ba
41 changed files with 112 additions and 308 deletions

View file

@ -1266,14 +1266,6 @@ pa_dbusiface_device *pa_dbusiface_device_new_source(pa_dbusiface_core *core, pa_
return d;
}
static void port_free_cb(void *p, void *userdata) {
pa_dbusiface_device_port *port = p;
pa_assert(port);
pa_dbusiface_device_port_free(port);
}
void pa_dbusiface_device_free(pa_dbusiface_device *d) {
pa_assert(d);
@ -1287,7 +1279,7 @@ void pa_dbusiface_device_free(pa_dbusiface_device *d) {
pa_assert_se(pa_dbus_protocol_remove_interface(d->dbus_protocol, d->path, source_interface_info.name) >= 0);
pa_source_unref(d->source);
}
pa_hashmap_free(d->ports, port_free_cb, NULL);
pa_hashmap_free(d->ports, (pa_free_cb_t) pa_dbusiface_device_port_free);
pa_proplist_free(d->proplist);
pa_dbus_protocol_unref(d->dbus_protocol);
pa_subscription_free(d->subscription);