Commit 1800bde3 authored by Max Kellermann's avatar Max Kellermann

player_thread: reinitialize music_buffer in !NDEBUG

To check for leaked music_chunk objects, free the music buffer on CLOSE_AUDIO. This invokes an assertion check which ensures that all chunks have been returned to the buffer.
parent a90c4e51
......@@ -780,6 +780,15 @@ static gpointer player_task(G_GNUC_UNUSED gpointer arg)
case PLAYER_COMMAND_CLOSE_AUDIO:
audio_output_all_close();
player_command_finished();
#ifndef NDEBUG
/* in the DEBUG build, check for leaked
music_chunk objects by freeing the
music_buffer */
music_buffer_free(player_buffer);
player_buffer = music_buffer_new(pc.buffer_chunks);
#endif
break;
case PLAYER_COMMAND_EXIT:
......
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