Commit 0122510f authored by Max Kellermann's avatar Max Kellermann

null: implemented finish() method

Free memory in the finish() method to make valgrind happy.
parent e1707c7b
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include <glib.h> #include <glib.h>
#include <assert.h>
struct null_data { struct null_data {
Timer *timer; Timer *timer;
}; };
...@@ -37,6 +39,16 @@ null_init(G_GNUC_UNUSED struct audio_output *audio_output, ...@@ -37,6 +39,16 @@ null_init(G_GNUC_UNUSED struct audio_output *audio_output,
return nd; return nd;
} }
static void
null_finish(void *data)
{
struct null_data *nd = data;
assert(nd->timer == NULL);
g_free(nd);
}
static bool static bool
null_open(void *data, struct audio_format *audio_format) null_open(void *data, struct audio_format *audio_format)
{ {
...@@ -85,6 +97,7 @@ null_cancel(void *data) ...@@ -85,6 +97,7 @@ null_cancel(void *data)
const struct audio_output_plugin null_output_plugin = { const struct audio_output_plugin null_output_plugin = {
.name = "null", .name = "null",
.init = null_init, .init = null_init,
.finish = null_finish,
.open = null_open, .open = null_open,
.close = null_close, .close = null_close,
.play = null_play, .play = null_play,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment