mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Cleanups
This commit is contained in:
parent
0e34d362d3
commit
9e26332c48
@ -715,29 +715,21 @@ static bool content_file_init_set_attribs(
|
||||
**/
|
||||
static bool content_file_init(
|
||||
content_information_ctx_t *content_ctx,
|
||||
struct string_list *content,
|
||||
char **error_string)
|
||||
{
|
||||
struct retro_game_info *info = NULL;
|
||||
struct string_list *content = NULL;
|
||||
bool ret = path_is_empty(RARCH_PATH_SUBSYSTEM)
|
||||
bool ret =
|
||||
path_is_empty(RARCH_PATH_SUBSYSTEM)
|
||||
? true : false;
|
||||
const struct retro_subsystem_info *special = path_is_empty(RARCH_PATH_SUBSYSTEM)
|
||||
const struct retro_subsystem_info *special =
|
||||
path_is_empty(RARCH_PATH_SUBSYSTEM)
|
||||
? NULL : content_file_init_subsystem(content_ctx, error_string, &ret);
|
||||
|
||||
if (!ret)
|
||||
if ( !ret ||
|
||||
!content_file_init_set_attribs(content, special, content_ctx, error_string))
|
||||
return false;
|
||||
|
||||
content = string_list_new();
|
||||
|
||||
if (!content)
|
||||
return false;
|
||||
|
||||
if (!content_file_init_set_attribs(content, special, content_ctx, error_string))
|
||||
{
|
||||
string_list_free(content);
|
||||
return false;
|
||||
}
|
||||
|
||||
info = (struct retro_game_info*)
|
||||
calloc(content->size, sizeof(*info));
|
||||
|
||||
@ -755,8 +747,6 @@ static bool content_file_init(
|
||||
free(info);
|
||||
}
|
||||
|
||||
string_list_free(content);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1699,6 +1689,7 @@ bool content_init(void)
|
||||
|
||||
bool ret = true;
|
||||
char *error_string = NULL;
|
||||
struct string_list *content = NULL;
|
||||
global_t *global = global_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
rarch_system_info_t *sys_info = runloop_get_system_info();
|
||||
@ -1755,15 +1746,18 @@ bool content_init(void)
|
||||
}
|
||||
|
||||
_content_is_inited = true;
|
||||
content = string_list_new();
|
||||
|
||||
if ( !temporary_content
|
||||
|| !content_file_init(&content_ctx, &error_string))
|
||||
|| !content_file_init(&content_ctx, content, &error_string))
|
||||
{
|
||||
content_deinit();
|
||||
|
||||
ret = false;
|
||||
}
|
||||
|
||||
string_list_free(content);
|
||||
|
||||
if (content_ctx.name_ips)
|
||||
free(content_ctx.name_ips);
|
||||
if (content_ctx.name_bps)
|
||||
|
Loading…
x
Reference in New Issue
Block a user