mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Create content_ctl
This commit is contained in:
parent
8702689aaa
commit
2836c9755a
@ -1482,7 +1482,7 @@ bool event_command(enum event_command cmd)
|
||||
input_driver_ctl(RARCH_INPUT_CTL_REMOTE_INIT, NULL);
|
||||
break;
|
||||
case EVENT_CMD_TEMPORARY_CONTENT_DEINIT:
|
||||
content_temporary_free();
|
||||
content_ctl(CONTENT_CTL_TEMPORARY_FREE, NULL);
|
||||
break;
|
||||
case EVENT_CMD_SUBSYSTEM_FULLPATHS_DEINIT:
|
||||
if (!global)
|
||||
|
21
content.c
21
content.c
@ -750,21 +750,19 @@ bool init_content_file(void)
|
||||
error:
|
||||
if (content)
|
||||
string_list_free(content);
|
||||
content_temporary_free();
|
||||
content_ctl(CONTENT_CTL_TEMPORARY_FREE, NULL);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* content_free_temporary:
|
||||
*
|
||||
* Frees temporary content handle.
|
||||
**/
|
||||
void content_temporary_free(void)
|
||||
bool content_ctl(enum content_ctl_state state, void *data)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
switch(state)
|
||||
{
|
||||
case CONTENT_CTL_TEMPORARY_FREE:
|
||||
if (!temporary_content)
|
||||
return;
|
||||
return false;
|
||||
|
||||
for (i = 0; i < temporary_content->size; i++)
|
||||
{
|
||||
@ -780,4 +778,11 @@ void content_temporary_free(void)
|
||||
string_list_free(temporary_content);
|
||||
|
||||
temporary_content = NULL;
|
||||
break;
|
||||
case CONTENT_CTL_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
10
content.h
10
content.h
@ -27,6 +27,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum content_ctl_state
|
||||
{
|
||||
CONTENT_CTL_NONE = 0,
|
||||
|
||||
/* Frees temporary content handle. */
|
||||
CONTENT_CTL_TEMPORARY_FREE
|
||||
};
|
||||
|
||||
/* Handles files related to libretro. */
|
||||
|
||||
/**
|
||||
@ -83,7 +91,7 @@ void save_ram_file(const char *path, int type);
|
||||
**/
|
||||
bool init_content_file(void);
|
||||
|
||||
void content_temporary_free(void);
|
||||
bool content_ctl(enum content_ctl_state state, void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user