fix some possible hangs

This commit is contained in:
dborth 2010-04-13 05:19:04 +00:00
parent f58a18857e
commit ea2cc55103
2 changed files with 13 additions and 6 deletions

View File

@ -865,6 +865,7 @@ SaveFile (char * buffer, char *filepath, size_t datasize, bool silent)
if(!written) if(!written)
{ {
unmountRequired[device] = true; unmountRequired[device] = true;
if(silent) break;
retry = ErrorPromptRetry("Error saving file!"); retry = ErrorPromptRetry("Error saving file!");
} }
} }

View File

@ -1291,7 +1291,12 @@ static int MenuGame()
#endif #endif
w.SetEffect(EFFECT_FADE, 15); w.SetEffect(EFFECT_FADE, 15);
}
ResumeGui();
if(lastMenu == MENU_NONE)
{
if (GCSettings.AutoSave == 1) if (GCSettings.AutoSave == 1)
{ {
SaveBatteryOrStateAuto(FILE_SRAM, SILENT); // save battery SaveBatteryOrStateAuto(FILE_SRAM, SILENT); // save battery
@ -1311,8 +1316,6 @@ static int MenuGame()
} }
} }
ResumeGui();
while(menu == MENU_NONE) while(menu == MENU_NONE)
{ {
usleep(THREAD_SLEEP); usleep(THREAD_SLEEP);
@ -4365,10 +4368,6 @@ MainMenu (int menu)
ShutoffRumble(); ShutoffRumble();
#endif #endif
// wait for keys to be depressed
while(MenuRequested())
usleep(THREAD_SLEEP);
CancelAction(); CancelAction();
HaltGui(); HaltGui();
@ -4406,4 +4405,11 @@ MainMenu (int menu)
free(gameScreenTex2); free(gameScreenTex2);
gameScreenTex2 = NULL; gameScreenTex2 = NULL;
} }
// wait for keys to be depressed
while(MenuRequested())
{
UpdatePads();
usleep(THREAD_SLEEP);
}
} }