Robustness fixes
This commit is contained in:
parent
16cce08fa7
commit
572b59d417
|
@ -1668,7 +1668,10 @@ static void free_temporary_content(void)
|
||||||
static void main_clear_state_drivers(void)
|
static void main_clear_state_drivers(void)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
bool inited = global->main_is_init;
|
bool inited = false;
|
||||||
|
if (!global)
|
||||||
|
return;
|
||||||
|
inited = global->main_is_init;
|
||||||
if (!inited)
|
if (!inited)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -981,6 +981,9 @@ void rarch_main_msg_queue_push(const char *msg, unsigned prio, unsigned duration
|
||||||
void rarch_main_msg_queue_free(void)
|
void rarch_main_msg_queue_free(void)
|
||||||
{
|
{
|
||||||
runloop_t *runloop = rarch_main_get_ptr();
|
runloop_t *runloop = rarch_main_get_ptr();
|
||||||
|
if (!runloop)
|
||||||
|
return;
|
||||||
|
|
||||||
if (runloop->msg_queue)
|
if (runloop->msg_queue)
|
||||||
msg_queue_free(runloop->msg_queue);
|
msg_queue_free(runloop->msg_queue);
|
||||||
runloop->msg_queue = NULL;
|
runloop->msg_queue = NULL;
|
||||||
|
@ -989,6 +992,9 @@ void rarch_main_msg_queue_free(void)
|
||||||
void rarch_main_msg_queue_init(void)
|
void rarch_main_msg_queue_init(void)
|
||||||
{
|
{
|
||||||
runloop_t *runloop = rarch_main_get_ptr();
|
runloop_t *runloop = rarch_main_get_ptr();
|
||||||
|
if (!runloop)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!runloop->msg_queue)
|
if (!runloop->msg_queue)
|
||||||
rarch_assert(runloop->msg_queue = msg_queue_new(8));
|
rarch_assert(runloop->msg_queue = msg_queue_new(8));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue