summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/sink.c')
-rw-r--r--src/pulsecore/sink.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index a66097bc..015cf4d5 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -671,7 +671,8 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, pa_memchunk *
case PA_SINK_MESSAGE_REMOVE_INPUT: {
pa_sink_input *i = userdata;
- pa_hashmap_remove(s->thread_info.inputs, PA_UINT32_TO_PTR(i->index));
+ if (pa_hashmap_remove(s->thread_info.inputs, PA_UINT32_TO_PTR(i->index)))
+ pa_sink_input_unref(i);
return 0;
}