mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
Add MENU_ENTRIES_CTL_DEINIT
This commit is contained in:
parent
fde4826754
commit
a1112d64a0
@ -539,7 +539,7 @@ void menu_free(menu_handle_t *menu)
|
||||
menu_driver_free(menu);
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SYSTEM_INFO_DEINIT, NULL);
|
||||
menu_display_free();
|
||||
menu_entries_free();
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_DEINIT, NULL);
|
||||
|
||||
event_command(EVENT_CMD_HISTORY_DEINIT);
|
||||
|
||||
|
@ -561,24 +561,6 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
void menu_entries_free(void)
|
||||
{
|
||||
menu_entries_t *entries = menu_entries_data;
|
||||
|
||||
if (!entries)
|
||||
return;
|
||||
|
||||
if (entries->list_settings)
|
||||
menu_setting_free(entries->list_settings);
|
||||
entries->list_settings = NULL;
|
||||
|
||||
menu_list_free(entries->menu_list);
|
||||
entries->menu_list = NULL;
|
||||
|
||||
free(menu_entries_data);
|
||||
menu_entries_data = NULL;
|
||||
}
|
||||
|
||||
void menu_entries_push(file_list_t *list, const char *path, const char *label,
|
||||
unsigned type, size_t directory_ptr, size_t entry_idx)
|
||||
{
|
||||
@ -721,12 +703,28 @@ rarch_setting_t *menu_entries_get_setting(uint32_t i)
|
||||
|
||||
bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
|
||||
{
|
||||
menu_entries_t *entries = menu_entries_data;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
/* Returns true if a Back button should be shown
|
||||
* (i.e. we are at least
|
||||
* one level deep in the menu hierarchy). */
|
||||
case MENU_ENTRIES_CTL_DEINIT:
|
||||
if (!entries)
|
||||
return false;
|
||||
|
||||
if (entries->list_settings)
|
||||
menu_setting_free(entries->list_settings);
|
||||
entries->list_settings = NULL;
|
||||
|
||||
menu_list_free(entries->menu_list);
|
||||
entries->menu_list = NULL;
|
||||
|
||||
free(menu_entries_data);
|
||||
menu_entries_data = NULL;
|
||||
return true;
|
||||
case MENU_ENTRIES_CTL_SHOW_BACK:
|
||||
/* Returns true if a Back button should be shown
|
||||
* (i.e. we are at least
|
||||
* one level deep in the menu hierarchy). */
|
||||
return (menu_entries_get_stack_size(0) > 1);
|
||||
case MENU_ENTRIES_CTL_NONE:
|
||||
default:
|
||||
|
@ -104,6 +104,7 @@ typedef struct menu_file_list_cbs
|
||||
enum menu_entries_ctl_state
|
||||
{
|
||||
MENU_ENTRIES_CTL_NONE = 0,
|
||||
MENU_ENTRIES_CTL_DEINIT,
|
||||
MENU_ENTRIES_CTL_SHOW_BACK
|
||||
};
|
||||
|
||||
@ -138,8 +139,6 @@ void menu_entries_push(file_list_t *list, const char *path, const char *label,
|
||||
|
||||
bool menu_entries_init(void);
|
||||
|
||||
void menu_entries_free(void);
|
||||
|
||||
void menu_entries_get_last_stack(const char **path, const char **label,
|
||||
unsigned *file_type, size_t *entry_idx);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user