audiod: Fix memory leak on exit: close slots.
authorAndre Noll <maan@systemlinux.org>
Sat, 6 Jul 2013 20:26:03 +0000 (22:26 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 22 Sep 2013 00:29:18 +0000 (02:29 +0200)
commiteec23a69402951596dfcd81825c79d355f7bba0c
tree7ad75ee871e606f030861db6c48329f4c64a6c48
parentcd5f0aa2b06b227f519600705fdde2a13f03424d
audiod: Fix memory leak on exit: close slots.

Currently we don't bother to close slots on exit. This is no problem
but it causes valgrind to report a bunch of memory leaks. This patch
makes it close all writers, filters and receivers on exit.

To this aim, the cleanup part of close_unused_slots() is abstracted out
into the new close_slot(), which is now also called from clean_exit()
for each slot, just before para_audiod exits. In order to avoid
forward declarations, clean_exit() had to be moved below the two
other functions.
audiod.c