This commit is contained in:
twinaphex 2018-09-17 10:02:31 +02:00
parent 3aec8abca9
commit 2d8eb9322a
3 changed files with 9 additions and 10 deletions

View File

@ -757,6 +757,8 @@ bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
break;
case MENU_ENTRIES_CTL_SETTINGS_DEINIT:
menu_setting_free(menu_entries_list_settings);
if (menu_entries_list_settings)
free(menu_entries_list_settings);
menu_entries_list_settings = NULL;
break;
case MENU_ENTRIES_CTL_SETTINGS_INIT:

View File

@ -1491,12 +1491,11 @@ static void get_string_representation_bind_device(void * data, char *s,
*
* Get associated label of a setting.
**/
void menu_setting_get_label(void *data, char *s,
void menu_setting_get_label(file_list_t *list, char *s,
size_t len, unsigned *w, unsigned type,
const char *menu_label, const char *label, unsigned idx)
{
rarch_setting_t *setting = NULL;
file_list_t *list = (file_list_t*)data;
if (!list || !label)
return;
@ -8877,15 +8876,16 @@ static bool setting_append_list(
return true;
}
void menu_setting_free(void *data)
void menu_setting_free(rarch_setting_t *setting)
{
unsigned values, n;
rarch_setting_t *setting = (rarch_setting_t*)data;
rarch_setting_t **list = &setting;
rarch_setting_t **list = NULL;
if (!setting)
return;
list = (rarch_setting_t**)&setting;
/* Free data which was previously tagged */
for (; setting_get_type(setting) != ST_NONE; (*list = *list + 1))
for (values = (unsigned)setting->free_flags, n = 0; values != 0; values >>= 1, n++)
@ -8910,9 +8910,6 @@ void menu_setting_free(void *data)
default:
break;
}
if (data)
free(data);
}
static void menu_setting_terminate_last(rarch_setting_t *list, unsigned pos)

View File

@ -116,7 +116,7 @@ void menu_setting_get_string_representation(void *data, char *s, size_t len);
*
* Get associated label of a setting.
**/
void menu_setting_get_label(void *data, char *s,
void menu_setting_get_label(file_list_t *list, char *s,
size_t len, unsigned *w, unsigned type,
const char *menu_label, const char *label, unsigned idx);
@ -164,7 +164,7 @@ void menu_settings_list_current_add_enum_value_idx(
rarch_setting_info_t *list_info,
enum msg_hash_enums enum_idx);
void menu_setting_free(void *data);
void menu_setting_free(rarch_setting_t *setting);
bool settings_list_append(rarch_setting_t **list,
rarch_setting_info_t *list_info);