From 5bb98a7fe27a1b27a8d3a7d54463ba1943774988 Mon Sep 17 00:00:00 2001 From: Alex Taber Date: Thu, 10 May 2018 21:17:35 -0400 Subject: [PATCH] Free everything when exiting theme preview --- source/loading.c | 1 + source/music.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/loading.c b/source/loading.c index 275b1c0..0ff19dd 100644 --- a/source/loading.c +++ b/source/loading.c @@ -501,6 +501,7 @@ Result load_audio(Entry_s entry, audio_s *audio) } else { free(audio->filebuf); free(audio); + fclose(file); DEBUG("fmemopen failed!\n"); return MAKERESULT(RL_FATAL, RS_NOTFOUND, RM_APPLICATION, RD_NOT_FOUND); } diff --git a/source/music.c b/source/music.c index 3dcc480..278008a 100644 --- a/source/music.c +++ b/source/music.c @@ -72,8 +72,11 @@ void thread_audio(void* data) { while(!audio->stop) { update_audio(audio); } - svcSignalEvent(audio->finished); free(audio->filebuf); + ov_clear(&audio->vf); + linearFree(audio->wave_buf[0].data_vaddr); + linearFree(audio->wave_buf[1].data_vaddr); + svcSignalEvent(audio->finished); free(audio); }