Commit f2cdac6e authored by Max Kellermann's avatar Max Kellermann Committed by Eric Wong

added output_buffer_free()

To do proper cleanup before exiting, we have to provide a destructor for OutputBuffer. One day, valgrind will not complain about memory leaks! git-svn-id: https://svn.musicpd.org/mpd/trunk@7315 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent b6881345
......@@ -36,6 +36,12 @@ void initOutputBuffer(OutputBuffer * cb, unsigned int size)
cb->currentChunk = -1;
}
void output_buffer_free(OutputBuffer * cb)
{
assert(cb->chunks != NULL);
free(cb->chunks);
}
void clearOutputBuffer(OutputBuffer * cb)
{
cb->end = cb->begin;
......
......@@ -62,6 +62,8 @@ typedef struct _OutputBuffer {
void initOutputBuffer(OutputBuffer * cb, unsigned int size);
void output_buffer_free(OutputBuffer * cb);
void clearOutputBuffer(OutputBuffer * cb);
void flushOutputBuffer(OutputBuffer * cb);
......
......@@ -116,5 +116,6 @@ void freePlayerData(void)
* access playerData_pd and we need to keep it available for them */
waitpid(-1, NULL, 0);
output_buffer_free(&playerData_pd.buffer);
free(playerData_pd.audioDeviceStates);
}
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