sim/sdlapp: Do not quit immediately on panicf, but wait for quit.

Change-Id: I2f0b4b560f00a43ad4b240911e4c30a162deb6e3
This commit is contained in:
Thomas Martitz 2014-01-29 06:50:36 +01:00
parent 7272a95b9c
commit 3a86352a5d
3 changed files with 15 additions and 1 deletions

View file

@ -278,7 +278,7 @@ static bool event_handler(SDL_Event *event)
}
case SDL_QUIT:
/* Will post SDL_USEREVENT in shutdown_hw() if successful. */
sys_poweroff();
sdl_sys_quit();
break;
case SDL_USEREVENT:
return true;

View file

@ -196,6 +196,14 @@ static int sdl_event_thread(void * param)
return 0;
}
static bool quitting;
void sdl_sys_quit(void)
{
quitting = true;
sys_poweroff();
}
void power_off(void)
{
/* Shut down SDL event loop */
@ -270,6 +278,11 @@ void system_reboot(void)
void system_exception_wait(void)
{
if (evt_thread)
{
while (!quitting)
SDL_Delay(10);
}
system_reboot();
}

View file

@ -56,6 +56,7 @@ void sys_poweroff(void);
void sys_handle_argv(int argc, char *argv[]);
void gui_message_loop(void);
void sim_do_exit(void) NORETURN_ATTR;
void sdl_sys_quit(void);
extern bool background; /* True if the background image is enabled */
extern bool showremote;