Merge pull request #7494 from p-sam/libnx-sanitize-exit

libnx: call retroarch_main_quit on exit
This commit is contained in:
Twinaphex 2018-10-27 20:23:05 +02:00 committed by GitHub
commit 3e04b88113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -62,10 +62,19 @@ static uint32_t *splashData = NULL;
static bool psmInitialized = false;
static AppletHookCookie applet_hook_cookie;
#ifdef NXLINK
extern bool nxlink_connected;
#endif
static void on_applet_hook(AppletHookType hook, void* param) {
if(hook == AppletHookType_OnExitRequest) {
RARCH_LOG("Got AppletHook OnExitRequest, exiting.\n");
retroarch_main_quit();
}
}
#endif /* HAVE_LIBNX */
static void get_first_valid_core(char *path_return)
@ -209,6 +218,7 @@ static void frontend_switch_deinit(void *data)
#ifndef HAVE_OPENGL
gfxExit();
#endif
appletUnlockExit();
#endif
}
@ -609,6 +619,8 @@ static void frontend_switch_init(void *data)
#ifdef HAVE_LIBNX
nifmInitialize();
appletLockExit();
appletHook(&applet_hook_cookie, on_applet_hook, NULL);
#ifndef HAVE_OPENGL
/* Init Resolution before initDefault */
gfxInitResolution(1280, 720);