mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Zero icon list even on menu drivers without icons
Otherwise there is a chance for a crash on program exit on certain gfx drivers because it tries to free uninitialized texture ids.
This commit is contained in:
parent
4a09907802
commit
398aa25c98
@ -489,7 +489,13 @@ static void explore_load_icons(explore_state_t *state)
|
||||
return;
|
||||
|
||||
system_count = RBUF_LEN(state->by[EXPLORE_BY_SYSTEM]);
|
||||
|
||||
/* unload any icons that could exist from a previous call to this */
|
||||
explore_unload_icons(state);
|
||||
|
||||
/* RBUF_RESIZE leaves memory uninitialised, have to zero it 'manually' */
|
||||
RBUF_RESIZE(state->icons, system_count);
|
||||
memset(state->icons, 0, RBUF_SIZEOF(state->icons));
|
||||
|
||||
fill_pathname_application_special(path, sizeof(path),
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_SYSICONS);
|
||||
@ -502,7 +508,6 @@ static void explore_load_icons(explore_state_t *state)
|
||||
for (i = 0; i != system_count; i++)
|
||||
{
|
||||
struct texture_image ti;
|
||||
state->icons[i] = 0;
|
||||
|
||||
strlcpy(path + pathlen,
|
||||
state->by[EXPLORE_BY_SYSTEM][i]->str, sizeof(path) - pathlen);
|
||||
|
Loading…
x
Reference in New Issue
Block a user