Use pa_hashmap_remove_and_free() where appropriate

This commit is contained in:
Tanu Kaskinen 2014-03-26 17:39:48 +02:00
parent 14e2553185
commit eca082a93f
14 changed files with 29 additions and 84 deletions

View file

@ -1324,13 +1324,9 @@ int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key) {
pa_assert_ctl_context();
pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
v = pa_hashmap_remove(i->volume_factor_items, key);
if (!v)
if (pa_hashmap_remove_and_free(i->volume_factor_items, key) < 0)
return -1;
volume_factor_entry_free(v);
switch (pa_hashmap_size(i->volume_factor_items)) {
case 0:
pa_cvolume_reset(&i->volume_factor, i->sample_spec.channels);