diff --git a/command_event.c b/command_event.c index e844a1ba0d..181c85c815 100644 --- a/command_event.c +++ b/command_event.c @@ -1332,8 +1332,7 @@ bool event_command(enum event_command cmd) fill_pathname_join(new_path, g_defaults.dir.core, SALAMANDER_FILE, sizeof(new_path)); runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, new_path); #endif - if (driver->frontend_ctx && driver->frontend_ctx->set_fork) - driver->frontend_ctx->set_fork(true, false); + frontend_driver_set_fork(true, false); } break; case EVENT_CMD_MENU_SAVE_CURRENT_CONFIG: diff --git a/dynamic.c b/dynamic.c index 0c5ba05e4f..d2624c5013 100644 --- a/dynamic.c +++ b/dynamic.c @@ -1303,8 +1303,7 @@ bool rarch_environment_cb(unsigned cmd, void *data) } #if defined(RARCH_CONSOLE) - if (driver->frontend_ctx && driver->frontend_ctx->set_fork) - driver->frontend_ctx->set_fork(true, true); + frontend_driver_set_fork(true, true); #elif defined(HAVE_DYNAMIC) rarch_ctl(RARCH_CTL_LOAD_CONTENT, NULL); #endif diff --git a/frontend/frontend_driver.c b/frontend/frontend_driver.c index b69c4d508b..4183eaa363 100644 --- a/frontend/frontend_driver.c +++ b/frontend/frontend_driver.c @@ -128,4 +128,13 @@ void frontend_driver_content_loaded(void) return; frontend->content_loaded(); } + +void frontend_driver_set_fork(bool a, bool b) +{ + frontend_ctx_driver_t *frontend = frontend_get_ptr(); + + if (!frontend || !frontend->set_fork) + return; + frontend->set_fork(a, b); +} #endif diff --git a/frontend/frontend_driver.h b/frontend/frontend_driver.h index f73ceae259..9df2ef7c70 100644 --- a/frontend/frontend_driver.h +++ b/frontend/frontend_driver.h @@ -18,6 +18,7 @@ #define __FRONTEND_DRIVER_H #include + #include #ifdef HAVE_CONFIG_H @@ -113,6 +114,8 @@ int frontend_driver_parse_drive_list(void *data); void frontend_driver_content_loaded(void); +void frontend_driver_set_fork(bool a, bool b); + #ifdef __cplusplus } #endif