null: implemented finish() method

Free memory in the finish() method to make valgrind happy.
This commit is contained in:
Max Kellermann 2009-01-22 16:06:45 +01:00
parent e1707c7ba3
commit 0122510f2c
1 changed files with 13 additions and 0 deletions

View File

@ -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,