diff --git a/driver.c b/driver.c index f7d30b36e5..29aaedb479 100644 --- a/driver.c +++ b/driver.c @@ -506,7 +506,7 @@ bool driver_update_system_av_info(const struct retro_system_av_info *info) } #ifdef HAVE_MENU -static void init_menu(void) +void init_menu(void) { if (driver.menu) return; @@ -517,6 +517,9 @@ static void init_menu(void) RARCH_ERR("Cannot initialize menu.\n"); rarch_fail(1, "init_menu()"); } + + if (driver.menu && driver.menu_ctx && driver.menu_ctx->context_reset) + driver.menu_ctx->context_reset(driver.menu); } #endif @@ -569,9 +572,6 @@ void init_drivers(void) #ifdef HAVE_MENU init_menu(); - - if (driver.menu && driver.menu_ctx && driver.menu_ctx->context_reset) - driver.menu_ctx->context_reset(driver.menu); #endif // Keep non-throttled state as good as possible. @@ -629,14 +629,9 @@ static void compute_monitor_fps_statistics(void) } } -void uninit_drivers(void) -{ - uninit_audio(); - - if (g_extern.system.hw_render_callback.context_destroy && !driver.video_cache_context) - g_extern.system.hw_render_callback.context_destroy(); - #ifdef HAVE_MENU +void uninit_menu(void) +{ if (driver.menu && driver.menu_ctx && driver.menu_ctx->context_destroy) driver.menu_ctx->context_destroy(driver.menu); @@ -645,8 +640,18 @@ void uninit_drivers(void) menu_free(driver.menu); driver.menu = NULL; } +} #endif +void uninit_drivers(void) +{ + uninit_audio(); + + if (g_extern.system.hw_render_callback.context_destroy && !driver.video_cache_context) + g_extern.system.hw_render_callback.context_destroy(); + + uninit_menu(); + uninit_video_input(); if (!driver.video_data_own) diff --git a/general.h b/general.h index 26e7bbb1f4..9a930e4e86 100644 --- a/general.h +++ b/general.h @@ -746,6 +746,11 @@ int rarch_main(int argc, char *argv[]); #define MAX_ARGS 32 #endif +#ifdef HAVE_MENU +void init_menu(void); +void uninit_menu(void); +#endif + void rarch_main_init_wrap(const struct rarch_main_wrap *args, int *argc, char **argv); int rarch_main_init(int argc, char *argv[]);