From 13ef64769d5e60fde92b9b6a4d5c6650e86b6c5e Mon Sep 17 00:00:00 2001 From: Andre Leiradella Date: Thu, 23 Feb 2017 00:10:16 +0000 Subject: [PATCH] Properly dispose the sound --- audio/audio_mixer.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/audio/audio_mixer.c b/audio/audio_mixer.c index 292d2f5bf4..70eff54f1f 100644 --- a/audio/audio_mixer.c +++ b/audio/audio_mixer.c @@ -404,11 +404,8 @@ audio_mixer_voice_t* audio_mixer_play(audio_mixer_sound_t* sound, bool repeat, f void audio_mixer_stop(audio_mixer_voice_t* voice) { - if (voice->type == AUDIO_MIXER_TYPE_WAV) - { - voice->stop_cb(voice, AUDIO_MIXER_SOUND_STOPPED); - voice->type = AUDIO_MIXER_TYPE_NONE; - } + voice->stop_cb(voice, AUDIO_MIXER_SOUND_STOPPED); + audio_mixer_destroy(voice->sound); } static void mix_wav(float* buffer, size_t num_frames, audio_mixer_voice_t* voice)