mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
sim/sdlapp: Do not quit immediately on panicf, but wait for quit.
Change-Id: I2f0b4b560f00a43ad4b240911e4c30a162deb6e3
This commit is contained in:
parent
7272a95b9c
commit
3a86352a5d
3 changed files with 15 additions and 1 deletions
|
@ -278,7 +278,7 @@ static bool event_handler(SDL_Event *event)
|
||||||
}
|
}
|
||||||
case SDL_QUIT:
|
case SDL_QUIT:
|
||||||
/* Will post SDL_USEREVENT in shutdown_hw() if successful. */
|
/* Will post SDL_USEREVENT in shutdown_hw() if successful. */
|
||||||
sys_poweroff();
|
sdl_sys_quit();
|
||||||
break;
|
break;
|
||||||
case SDL_USEREVENT:
|
case SDL_USEREVENT:
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -196,6 +196,14 @@ static int sdl_event_thread(void * param)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool quitting;
|
||||||
|
|
||||||
|
void sdl_sys_quit(void)
|
||||||
|
{
|
||||||
|
quitting = true;
|
||||||
|
sys_poweroff();
|
||||||
|
}
|
||||||
|
|
||||||
void power_off(void)
|
void power_off(void)
|
||||||
{
|
{
|
||||||
/* Shut down SDL event loop */
|
/* Shut down SDL event loop */
|
||||||
|
@ -270,6 +278,11 @@ void system_reboot(void)
|
||||||
|
|
||||||
void system_exception_wait(void)
|
void system_exception_wait(void)
|
||||||
{
|
{
|
||||||
|
if (evt_thread)
|
||||||
|
{
|
||||||
|
while (!quitting)
|
||||||
|
SDL_Delay(10);
|
||||||
|
}
|
||||||
system_reboot();
|
system_reboot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@ void sys_poweroff(void);
|
||||||
void sys_handle_argv(int argc, char *argv[]);
|
void sys_handle_argv(int argc, char *argv[]);
|
||||||
void gui_message_loop(void);
|
void gui_message_loop(void);
|
||||||
void sim_do_exit(void) NORETURN_ATTR;
|
void sim_do_exit(void) NORETURN_ATTR;
|
||||||
|
void sdl_sys_quit(void);
|
||||||
|
|
||||||
extern bool background; /* True if the background image is enabled */
|
extern bool background; /* True if the background image is enabled */
|
||||||
extern bool showremote;
|
extern bool showremote;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue