summaryrefslogtreecommitdiff
path: root/src/pulsecore/sink.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/pulsecore/sink.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/pulsecore/sink.c')
-rw-r--r--src/pulsecore/sink.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 175cfe50f..171072e17 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -715,7 +715,6 @@ void pa_sink_unlink(pa_sink* s) {
/* Called from main context */
static void sink_free(pa_object *o) {
pa_sink *s = PA_SINK(o);
- pa_sink_input *i;
pa_assert(s);
pa_assert_ctl_context();
@@ -732,11 +731,7 @@ static void sink_free(pa_object *o) {
}
pa_idxset_free(s->inputs, NULL, NULL);
-
- while ((i = pa_hashmap_steal_first(s->thread_info.inputs)))
- pa_sink_input_unref(i);
-
- pa_hashmap_free(s->thread_info.inputs, NULL, NULL);
+ pa_hashmap_free(s->thread_info.inputs, (pa_free_cb_t) pa_sink_input_unref);
if (s->silence.memblock)
pa_memblock_unref(s->silence.memblock);