Pressing hotkey should invoke same operation as manually selecting

'Quit' from the menu - should hopefully fix issues with flushing
SRAM to disk/saving autostate
This commit is contained in:
twinaphex 2017-05-08 03:41:23 +02:00
parent fb78a3a017
commit 0815055906
3 changed files with 10 additions and 3 deletions

View File

@ -1756,7 +1756,7 @@ static bool command_event_main_state(unsigned cmd)
return ret;
}
void handle_quit_event(void)
bool command_event_quit(void)
{
command_event(CMD_EVENT_AUTOSAVE_STATE, NULL);
command_event(CMD_EVENT_DISABLE_OVERRIDES, NULL);
@ -1772,6 +1772,8 @@ void handle_quit_event(void)
#ifdef HAVE_MENU
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
#endif
return true;
}
static bool command_event_resize_windowed_scale(void)
@ -1993,8 +1995,7 @@ bool command_event(enum event_command cmd, void *data)
}
break;
case CMD_EVENT_QUIT:
handle_quit_event();
break;
return command_event_quit();
case CMD_EVENT_CHEEVOS_HARDCORE_MODE_TOGGLE:
#ifdef HAVE_CHEEVOS
cheevos_toggle_hardcore_mode();

View File

@ -243,6 +243,8 @@ bool command_set(command_handle_t *handle);
bool command_free(command_t *handle);
bool command_event_quit(void);
/**
* command_event:
* @cmd : Command index.

View File

@ -56,6 +56,7 @@
#endif
#include "autosave.h"
#include "command.h"
#include "configuration.h"
#include "driver.h"
#include "movie.h"
@ -758,8 +759,11 @@ static enum runloop_state runloop_check_state(
runloop_core_shutdown_initiated = false;
}
else
{
command_event_quit();
return RUNLOOP_STATE_QUIT;
}
}
#ifdef HAVE_MENU
if (menu_driver_is_alive())