Fix segfault on exit

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
Mahyar Koshkouei
2017-02-14 17:58:21 +00:00
parent b7f3a70406
commit 295edd06f0
2 changed files with 6 additions and 4 deletions

View File

@@ -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();

View File

@@ -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)
{