mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-25 20:32:22 +00:00
Rewrite rich label allocation
This commit is contained in:
parent
f398f44253
commit
3551ac825c
@ -89,6 +89,11 @@ void menu_entry_free(menu_entry_t *entry)
|
||||
free(entry->path);
|
||||
if (entry->value && !string_is_empty(entry->value))
|
||||
free(entry->value);
|
||||
entry->path = NULL;
|
||||
entry->label = NULL;
|
||||
entry->value = NULL;
|
||||
entry->sublabel = NULL;
|
||||
entry->rich_label = NULL;
|
||||
}
|
||||
|
||||
void menu_entry_init(menu_entry_t *entry)
|
||||
@ -338,14 +343,17 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx,
|
||||
|
||||
if (cbs->action_label)
|
||||
{
|
||||
entry->rich_label = (char*)malloc(255 *
|
||||
sizeof(char));
|
||||
entry->rich_label[0] = '\0';
|
||||
char richlabeltmp[255];
|
||||
richlabeltmp[0] = '\0';
|
||||
|
||||
cbs->action_label(list,
|
||||
entry->type, (unsigned)i,
|
||||
label, path,
|
||||
entry->rich_label,
|
||||
255 * sizeof(char));
|
||||
richlabeltmp,
|
||||
sizeof(richlabeltmp));
|
||||
|
||||
if (!string_is_empty(richlabeltmp))
|
||||
entry->rich_label = strdup(richlabeltmp);
|
||||
}
|
||||
|
||||
if (cbs->action_sublabel)
|
||||
|
Loading…
x
Reference in New Issue
Block a user