aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-22 16:06:45 +0100
committerMax Kellermann <max@duempel.org>2009-01-22 16:06:45 +0100
commit0122510f2c85ab00bf5b591d25986188cdc33d7f (patch)
tree6fc7d658442ea4ad4994f7589df9170fa2db0c2b
parente1707c7ba3b831e133f2206e0e9b6cf63be34512 (diff)
downloadmpd-0122510f2c85ab00bf5b591d25986188cdc33d7f.tar.gz
mpd-0122510f2c85ab00bf5b591d25986188cdc33d7f.tar.xz
mpd-0122510f2c85ab00bf5b591d25986188cdc33d7f.zip
null: implemented finish() method
Free memory in the finish() method to make valgrind happy.
-rw-r--r--src/output/null_plugin.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/output/null_plugin.c b/src/output/null_plugin.c
index 139921a3f..a1eb0196f 100644
--- a/src/output/null_plugin.c
+++ b/src/output/null_plugin.c
@@ -21,6 +21,8 @@
#include <glib.h>
+#include <assert.h>
+
struct null_data {
Timer *timer;
};
@@ -37,6 +39,16 @@ null_init(G_GNUC_UNUSED struct audio_output *audio_output,
return nd;
}
+static void
+null_finish(void *data)
+{
+ struct null_data *nd = data;
+
+ assert(nd->timer == NULL);
+
+ g_free(nd);
+}
+
static bool
null_open(void *data, struct audio_format *audio_format)
{
@@ -85,6 +97,7 @@ null_cancel(void *data)
const struct audio_output_plugin null_output_plugin = {
.name = "null",
.init = null_init,
+ .finish = null_finish,
.open = null_open,
.close = null_close,
.play = null_play,