mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
(Menu) menu_common.c - cleanups
This commit is contained in:
parent
51fbc4276c
commit
777529db96
@ -164,13 +164,16 @@ void load_menu_game_history(unsigned game_index)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menu_init_history(menu_handle_t *menu)
|
static void menu_free_history(menu_handle_t *menu)
|
||||||
{
|
{
|
||||||
if (menu->history)
|
if (menu->history)
|
||||||
{
|
|
||||||
content_history_free(menu->history);
|
content_history_free(menu->history);
|
||||||
menu->history = NULL;
|
menu->history = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void menu_init_history(menu_handle_t *menu)
|
||||||
|
{
|
||||||
|
menu_free_history(menu);
|
||||||
|
|
||||||
if (*g_extern.config_path)
|
if (*g_extern.config_path)
|
||||||
{
|
{
|
||||||
@ -321,6 +324,15 @@ void *menu_init(const void *data)
|
|||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void menu_free_shaders(menu_handle_t *menu)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_SHADER_MANAGER
|
||||||
|
if (menu->shader)
|
||||||
|
free(menu->shader);
|
||||||
|
menu->shader = NULL;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void menu_free(void *data)
|
void menu_free(void *data)
|
||||||
{
|
{
|
||||||
menu_handle_t *menu = (menu_handle_t*)data;
|
menu_handle_t *menu = (menu_handle_t*)data;
|
||||||
@ -328,11 +340,7 @@ void menu_free(void *data)
|
|||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
menu_free_shaders(menu);
|
||||||
if (menu->shader)
|
|
||||||
free(menu->shader);
|
|
||||||
menu->shader = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (driver.menu_ctx && driver.menu_ctx->free)
|
if (driver.menu_ctx && driver.menu_ctx->free)
|
||||||
driver.menu_ctx->free(menu);
|
driver.menu_ctx->free(menu);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user