Create path_clear_all

This commit is contained in:
twinaphex 2016-09-17 13:47:26 +02:00
parent f4e1ffeabf
commit 471347689d
5 changed files with 16 additions and 2 deletions

View File

@ -247,7 +247,7 @@ bool core_option_manager_flush(core_option_manager_t *opt)
* successfully saved to disk, otherwise false (0).
**/
bool core_option_manager_flush_game_specific(
core_option_manager_t *opt, char* path)
core_option_manager_t *opt, const char* path)
{
size_t i;
for (i = 0; i < opt->size; i++)

View File

@ -90,7 +90,7 @@ bool core_option_manager_flush(core_option_manager_t *opt);
* successfully saved to disk, otherwise false (0).
**/
bool core_option_manager_flush_game_specific(
core_option_manager_t *opt, char* path);
core_option_manager_t *opt, const char* path);
/**
* core_option_manager_free:

11
paths.c
View File

@ -513,6 +513,17 @@ const char *path_get_core_options(void)
return NULL;
}
void path_clear_all(void)
{
global_t *global = global_get_ptr();
path_clear_core();
path_clear_core_options();
if (global)
memset(&global->path, 0, sizeof(struct rarch_path));
}
enum rarch_content_type path_is_media_type(const char *path)
{
char ext_lower[PATH_MAX_LENGTH] = {0};

View File

@ -61,6 +61,8 @@ void path_clear_core(void);
void path_clear_core_options(void);
void path_clear_all(void);
enum rarch_content_type path_is_media_type(const char *path);
RETRO_END_DECLS

View File

@ -745,6 +745,7 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
runloop_frontend_key_event = NULL;
audio_driver_unset_callback();
path_clear_all();
memset(&runloop_system, 0, sizeof(rarch_system_info_t));
break;
case RUNLOOP_CTL_SET_FRAME_TIME_LAST: