From 9637e4ee29c3888015aba307ceb5f202d534d11f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Sep 2016 17:17:43 +0200 Subject: [PATCH] Attempt to fix issue #3605 --- command.c | 13 ++----------- frontend/frontend.c | 6 +++++- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/command.c b/command.c index 9a22f9bdea..d9682cbc84 100644 --- a/command.c +++ b/command.c @@ -1596,17 +1596,8 @@ void command_event_save_current_config(int override_type) RARCH_ERR("[overrides] %s\n", msg); } } - else - { - settings_t *settings = config_get_ptr(); - - /* Save last core-specific config to the default config location, - * needed on consoles for core switching and reusing last good - * config for new cores. - */ - if (settings->config_save_on_exit && !path_is_config_empty()) - command_event_save_config(path_get_config(), msg, sizeof(msg)); - } + else if (!path_is_config_empty()) + command_event_save_config(path_get_config(), msg, sizeof(msg)); if (!string_is_empty(msg)) runloop_msg_queue_push(msg, 1, 180, true); diff --git a/frontend/frontend.c b/frontend/frontend.c index 13df9a5a2b..a8f8abe7c6 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -27,6 +27,7 @@ #endif #include "frontend.h" +#include "../configuration.h" #include "../ui/ui_companion_driver.h" #include "../tasks/tasks_internal.h" @@ -45,7 +46,10 @@ **/ void main_exit(void *args) { - command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL); + settings_t *settings = config_get_ptr(); + + if (settings->config_save_on_exit) + command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL); #ifdef HAVE_MENU /* Do not want menu context to live any more. */