summaryrefslogtreecommitdiff
path: root/src/modules/module-augment-properties.c
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2013-02-12 21:36:53 +0200
committerTanu Kaskinen <tanuk@iki.fi>2013-02-16 01:12:21 +0200
commit8872c238ba6748c76455ecc6827b83ebcb1dd469 (patch)
tree1f73094f08088d08ded489f479cbf54ab7769214 /src/modules/module-augment-properties.c
parentdcf043842e6bef0680bb246e7266b7c0829d34d4 (diff)
downloadpulseaudio-8872c238ba6748c76455ecc6827b83ebcb1dd469.tar.gz
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.
Diffstat (limited to 'src/modules/module-augment-properties.c')
-rw-r--r--src/modules/module-augment-properties.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/modules/module-augment-properties.c b/src/modules/module-augment-properties.c
index 6bba2b301..ee3b54c78 100644
--- a/src/modules/module-augment-properties.c
+++ b/src/modules/module-augment-properties.c
@@ -347,14 +347,8 @@ void pa__done(pa_module *m) {
if (u->client_proplist_changed_slot)
pa_hook_slot_free(u->client_proplist_changed_slot);
- if (u->cache) {
- struct rule *r;
-
- while ((r = pa_hashmap_steal_first(u->cache)))
- rule_free(r);
-
- pa_hashmap_free(u->cache, NULL, NULL);
- }
+ if (u->cache)
+ pa_hashmap_free(u->cache, (pa_free_cb_t) rule_free);
pa_xfree(u);
}