Call rarch_main_data_deinit from outside
This commit is contained in:
parent
58cf81d1d8
commit
f6a791a3e0
|
@ -866,6 +866,7 @@ static int rarch_main_iterate_quit(void)
|
||||||
if (g_extern.core_shutdown_initiated
|
if (g_extern.core_shutdown_initiated
|
||||||
&& g_settings.load_dummy_on_core_shutdown)
|
&& g_settings.load_dummy_on_core_shutdown)
|
||||||
{
|
{
|
||||||
|
rarch_main_data_deinit();
|
||||||
if (!rarch_main_command(RARCH_CMD_PREPARE_DUMMY))
|
if (!rarch_main_command(RARCH_CMD_PREPARE_DUMMY))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,8 @@ void rarch_main_data_clear_state(void);
|
||||||
|
|
||||||
void rarch_main_data_iterate(void);
|
void rarch_main_data_iterate(void);
|
||||||
|
|
||||||
|
void rarch_main_data_deinit(void);
|
||||||
|
|
||||||
void rarch_main_data_init_queues(void);
|
void rarch_main_data_init_queues(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -75,6 +75,7 @@ typedef struct nbio_handle
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
THREAD_CODE_INIT = 0,
|
THREAD_CODE_INIT = 0,
|
||||||
|
THREAD_CODE_DEINIT,
|
||||||
THREAD_CODE_ALIVE,
|
THREAD_CODE_ALIVE,
|
||||||
} thread_code_enum;
|
} thread_code_enum;
|
||||||
|
|
||||||
|
@ -772,7 +773,7 @@ static void data_runloop_thread_deinit(data_runloop_t *runloop)
|
||||||
runloop->thread_inited = false;
|
runloop->thread_inited = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rarch_main_data_deinit(void)
|
void rarch_main_data_deinit(void)
|
||||||
{
|
{
|
||||||
data_runloop_t *runloop = &g_data_runloop;
|
data_runloop_t *runloop = &g_data_runloop;
|
||||||
|
|
||||||
|
@ -781,7 +782,10 @@ static void rarch_main_data_deinit(void)
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
if (runloop->thread_inited)
|
if (runloop->thread_inited)
|
||||||
|
{
|
||||||
data_runloop_thread_deinit(runloop);
|
data_runloop_thread_deinit(runloop);
|
||||||
|
g_data_runloop.thread_code = THREAD_CODE_DEINIT;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
runloop->inited = false;
|
runloop->inited = false;
|
||||||
|
@ -867,6 +871,8 @@ void rarch_main_data_iterate(void)
|
||||||
case THREAD_CODE_INIT:
|
case THREAD_CODE_INIT:
|
||||||
rarch_main_data_thread_init();
|
rarch_main_data_thread_init();
|
||||||
break;
|
break;
|
||||||
|
case THREAD_CODE_DEINIT:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue