diff --git a/command.c b/command.c index ad8ec8c5c6..58e1d76399 100644 --- a/command.c +++ b/command.c @@ -1894,21 +1894,37 @@ bool command_event(enum event_command cmd, void *data) return false; break; case CMD_EVENT_UNLOAD_CORE: + case CMD_EVENT_QUIT: command_event(CMD_EVENT_AUTOSAVE_STATE, NULL); command_event(CMD_EVENT_DISABLE_OVERRIDES, NULL); - if (content_is_inited()) - if (!task_push_content_load_default( - NULL, NULL, - &content_info, - CORE_TYPE_DUMMY, - CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE, - NULL, NULL)) - return false; + switch (cmd) + { + case CMD_EVENT_UNLOAD_CORE: + if (content_is_inited()) + if (!task_push_content_load_default( + NULL, NULL, + &content_info, + CORE_TYPE_DUMMY, + CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE, + NULL, NULL)) + return false; + break; + default: + break; + } + command_event(CMD_EVENT_LOAD_CORE_DEINIT, NULL); - break; - case CMD_EVENT_QUIT: - retroarch_main_quit(); + + switch (cmd) + { + case CMD_EVENT_QUIT: + runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL); + rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL); + break; + default: + break; + } break; case CMD_EVENT_CHEEVOS_HARDCORE_MODE_TOGGLE: #ifdef HAVE_CHEEVOS diff --git a/retroarch.c b/retroarch.c index b1d18ad545..60ffa88aa9 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1689,9 +1689,3 @@ void retroarch_fail(int error_code, const char *error) strlcpy(error_string, error, sizeof(error_string)); longjmp(error_sjlj_context, error_code); } - -void retroarch_main_quit(void) -{ - runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL); - rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL); -} diff --git a/retroarch.h b/retroarch.h index 4564a6c42e..20508b8bc8 100644 --- a/retroarch.h +++ b/retroarch.h @@ -150,8 +150,6 @@ void retroarch_fail(int error_code, const char *error); **/ bool retroarch_main_init(int argc, char *argv[]); -void retroarch_main_quit(void); - RETRO_END_DECLS #endif