(audio_driver.c) Audio mixer - Plug another memory leak

This commit is contained in:
twinaphex 2017-05-31 01:23:04 +02:00
parent 7053a74d3f
commit b13dc7415c

View File

@ -944,8 +944,12 @@ static void audio_mixer_play_stop_cb(audio_mixer_sound_t *sound, unsigned reason
{
case AUDIO_MIXER_SOUND_FINISHED:
audio_mixer_destroy(sound);
if (audio_mixer_streams[idx].buf != NULL)
free(audio_mixer_streams[idx].buf);
audio_mixer_streams[idx].state = AUDIO_STREAM_STATE_NONE;
audio_mixer_streams[idx].volume = 0.0f;
audio_mixer_streams[idx].buf = NULL;
audio_mixer_streams[idx].stop_cb = NULL;
audio_mixer_streams[idx].handle = NULL;
audio_mixer_streams[idx].voice = NULL;