From 295edd06f0092fe2a95c0cf42e8b5c749e7be8a0 Mon Sep 17 00:00:00 2001 From: Mahyar Koshkouei Date: Tue, 14 Feb 2017 17:58:21 +0000 Subject: [PATCH] Fix segfault on exit Signed-off-by: Mahyar Koshkouei --- source/main.c | 6 +++--- source/playback.c | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/main.c b/source/main.c index 322e26b..eeb8c20 100644 --- a/source/main.c +++ b/source/main.c @@ -129,7 +129,7 @@ int main(int argc, char **argv) if(kDown & KEY_B) { stopPlayback(); - changeFile(NULL, NULL); + changeFile(NULL, &playbackInfo); consoleSelect(&topScreen); puts("Stopped"); continue; @@ -238,8 +238,8 @@ int main(int argc, char **argv) out: puts("Exiting..."); runThreads = false; - stopPlayback(); - changeFile(NULL, NULL); + svcSignalEvent(playbackFailEvent); + changeFile(NULL, &playbackInfo); gfxExit(); sdmcExit(); diff --git a/source/playback.c b/source/playback.c index 82af711..17edf8e 100644 --- a/source/playback.c +++ b/source/playback.c @@ -13,7 +13,9 @@ static volatile bool stop = false; /** - * Should only be called from a new thread only. + * Should only be called from a new thread only, and have only one playback + * thread at time. This function has not been written for more than one + * playback thread in mind. */ void playFile(void* infoIn) {