Skip to content

Commit cd2cb29

Browse files
committed
task_content: drop spurious CMD_EVENT_CORE_INIT(NULL) after subsystem init
In the PENDING_SUBSYSTEM_INIT branch, content_load fires command_event(CMD_EVENT_CORE_INIT, NULL) immediately after a successful retroarch_main_init. The handler at retroarch.c:4440-4448 performs three pre-init side effects before falling through to the !type check that returns false: - content_reset_savestate_backups() - disk_control_set_ext_callback(disk_control, NULL) - audio_st->callback.{callback,set_state} = NULL retroarch_main_init has already initialized the core via its own CMD_EVENT_CORE_INIT(&type) at line 8273. The core's retro_init may have called env(SET_DISK_CONTROL_INTERFACE, ...) and env(SET_AUDIO_CALLBACK, ...) at that point, populating the very callbacks this second call wipes. Result: subsystems on cores that use disk control or audio callback lose those interfaces immediately after content load. The actual core init does not run twice (the !type branch returns false), so the only effect of this call is the destructive side effects. Drop the call. content_clear_subsystem() still runs to clear the pending flag.
1 parent 0b1baa3 commit cd2cb29

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

tasks/task_content.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,10 +1610,7 @@ static bool content_load(content_ctx_info_t *info,
16101610
return false;
16111611

16121612
if (p_content->flags & CONTENT_ST_FLAG_PENDING_SUBSYSTEM_INIT)
1613-
{
1614-
command_event(CMD_EVENT_CORE_INIT, NULL);
16151613
content_clear_subsystem();
1616-
}
16171614

16181615
#ifdef HAVE_GFX_WIDGETS
16191616
#ifdef HAVE_CONFIGFILE

0 commit comments

Comments
 (0)