libnx: call retroarch_main_quit on exit

This commit is contained in:
p-sam 2018-10-09 21:39:48 +00:00
parent c00d3e809a
commit 4c5c2170b6
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);