From a8dc7056dee447b4c9263e1b57d821c1ce8da5f1 Mon Sep 17 00:00:00 2001 From: sonninnos Date: Sun, 4 Jan 2026 21:32:47 +0200 Subject: [PATCH] Fix runtime log state slot saving with override unloading --- retroarch.c | 23 ++++++++++++++--------- runloop.c | 5 +---- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/retroarch.c b/retroarch.c index 8388dfbb0f..af97b88ab3 100644 --- a/retroarch.c +++ b/retroarch.c @@ -8082,18 +8082,19 @@ bool retroarch_main_init(int argc, char *argv[]) else input_remapping_restore_global_config(true, false); -#ifdef HAVE_CONFIGFILE - /* Reload the original config */ - if (runloop_st->flags & RUNLOOP_FLAG_OVERRIDES_ACTIVE) - config_unload_override(); -#endif - #ifdef HAVE_DYNAMIC /* Ensure that currently loaded core is properly * deinitialised */ if (runloop_st->current_core_type != CORE_TYPE_DUMMY) command_event(CMD_EVENT_CORE_DEINIT, NULL); #endif + +#ifdef HAVE_CONFIGFILE + /* Reload the original config */ + if (runloop_st->flags & RUNLOOP_FLAG_OVERRIDES_ACTIVE) + config_unload_override(); +#endif + /* Attempt initializing dummy core */ runloop_st->current_core_type = CORE_TYPE_DUMMY; if (!command_event(CMD_EVENT_CORE_INIT, &runloop_st->current_core_type)) @@ -8681,6 +8682,12 @@ bool retroarch_main_quit(void) * save state file may be truncated) */ content_wait_for_save_state_task(); + runloop_runtime_log_deinit(runloop_st, + settings->bools.content_runtime_log, + settings->bools.content_runtime_log_aggregate, + settings->paths.directory_runtime_log, + settings->paths.directory_playlist); + if ( (runloop_st->flags & RUNLOOP_FLAG_REMAPS_CORE_ACTIVE) || (runloop_st->flags & RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE) || (runloop_st->flags & RUNLOOP_FLAG_REMAPS_GAME_ACTIVE) @@ -8694,11 +8701,9 @@ bool retroarch_main_quit(void) input_remapping_restore_global_config(true, false); #ifdef HAVE_CONFIGFILE + /* Reload the original config */ if (runloop_st->flags & RUNLOOP_FLAG_OVERRIDES_ACTIVE) - { - /* Reload the original config */ config_unload_override(); - } #endif #ifdef HAVE_MENU diff --git a/runloop.c b/runloop.c index f6f2e7cdf4..8ba2d557de 100644 --- a/runloop.c +++ b/runloop.c @@ -660,7 +660,6 @@ static void runloop_update_runtime_log( free(runtime_log); } - void runloop_runtime_log_deinit( runloop_state_t *runloop_st, bool content_runtime_log, @@ -4125,11 +4124,9 @@ void runloop_event_deinit_core(void) driver_uninit(DRIVERS_CMD_ALL, (enum driver_lifetime_flags)0); #ifdef HAVE_CONFIGFILE + /* Reload the original config */ if (runloop_st->flags & RUNLOOP_FLAG_OVERRIDES_ACTIVE) - { - /* Reload the original config */ config_unload_override(); - } #endif #if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL) runloop_st->runtime_shader_preset_path[0] = '\0';