Add more state to RARCH_MENU_CTL_DEINIT

This commit is contained in:
twinaphex 2016-02-10 07:17:26 +01:00
parent 1e05027785
commit 9bb1127727
2 changed files with 4 additions and 6 deletions

View File

@ -387,11 +387,7 @@ static void uninit_drivers(int flags)
{
#ifdef HAVE_MENU
if (flags & DRIVER_MENU)
{
menu_driver_ctl(RARCH_MENU_CTL_CONTEXT_DESTROY, NULL);
if (!menu_driver_ctl(RARCH_MENU_CTL_OWNS_DRIVER, NULL))
menu_driver_ctl(RARCH_MENU_CTL_DEINIT, NULL);
}
menu_driver_ctl(RARCH_MENU_CTL_DEINIT, NULL);
#endif
if ((flags & DRIVER_LOCATION) && !location_driver_ctl(RARCH_LOCATION_CTL_OWNS_DRIVER, NULL))

View File

@ -530,6 +530,9 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
case RARCH_MENU_CTL_OWNS_DRIVER:
return menu_driver_data_own;
case RARCH_MENU_CTL_DEINIT:
menu_driver_ctl(RARCH_MENU_CTL_CONTEXT_DESTROY, NULL);
if (menu_driver_ctl(RARCH_MENU_CTL_OWNS_DRIVER, NULL))
return true;
if (menu_driver_data)
{
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_FREE, NULL);
@ -563,7 +566,6 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
if (!menu_driver_data || !menu_init())
{
menu_driver_ctl(RARCH_MENU_CTL_DEINIT, NULL);
retro_fail(1, "init_menu()");
return false;
}