diff --git a/configuration.c b/configuration.c index d6b246f9da..19220baf9f 100644 --- a/configuration.c +++ b/configuration.c @@ -3157,12 +3157,18 @@ bool config_replace(char *path) return true; } -const char *config_get_active_core_path(void) +char *config_get_active_core_path_ptr(void) { settings_t *settings = config_get_ptr(); return settings->path.libretro; } +const char *config_get_active_core_path(void) +{ + const char *core_path = (const char *)config_get_active_core_path_ptr(); + return core_path; +} + bool config_active_core_path_is_empty(void) { settings_t *settings = config_get_ptr(); diff --git a/configuration.h b/configuration.h index 8b355c4716..0b10bb46e5 100644 --- a/configuration.h +++ b/configuration.h @@ -649,6 +649,8 @@ const char *config_get_active_path(void); const char *config_get_active_core_path(void); +char *config_get_active_core_path_ptr(void); + void config_set_active_core_path(const char *path); void config_clear_active_core_path(void); diff --git a/dynamic.c b/dynamic.c index 597508d145..3b108fda7e 100644 --- a/dynamic.c +++ b/dynamic.c @@ -336,7 +336,8 @@ static void load_dynamic_core(void) /* Need to use absolute path for this setting. It can be * saved to content history, and a relative path would * break in that scenario. */ - path_resolve_realpath(settings->path.libretro, + path_resolve_realpath( + config_get_active_core_path_ptr(), config_get_active_core_path_size()); RARCH_LOG("Loading dynamic libretro core from: \"%s\"\n", diff --git a/frontend/frontend.c b/frontend/frontend.c index 48e1850bac..47e09388c8 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -40,8 +40,6 @@ **/ void main_exit(void *args) { - settings_t *settings = config_get_ptr(); - command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL); #ifdef HAVE_MENU @@ -57,7 +55,8 @@ void main_exit(void *args) #endif frontend_driver_deinit(args); - frontend_driver_exitspawn(settings->path.libretro, + frontend_driver_exitspawn( + config_get_active_core_path_ptr(), config_get_active_core_path_size()); rarch_ctl(RARCH_CTL_DESTROY, NULL); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index b581364035..e3ee796dde 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -4023,7 +4023,7 @@ static bool setting_append_list( if (frontend_driver_has_fork()) #endif { - char ext_name[PATH_MAX_LENGTH]; + char ext_name[PATH_MAX_LENGTH] = {0}; if (frontend_driver_get_core_extension(ext_name, sizeof(ext_name))) { @@ -4035,7 +4035,7 @@ static bool setting_append_list( &subgroup_info, parent_group); (*list)[list_info->index - 1].size = config_get_active_core_path_size(); - (*list)[list_info->index - 1].value.target.string = settings->path.libretro; + (*list)[list_info->index - 1].value.target.string = config_get_active_core_path_ptr(); (*list)[list_info->index - 1].values = ext_name; menu_settings_list_current_add_cmd(list, list_info, CMD_EVENT_LOAD_CORE); settings_data_list_current_add_flags(list, list_info, SD_FLAG_BROWSER_ACTION);